4 ms·
I too don't see how it is useful but it's certainly a thing. The Solaris implementation looks like this: #!/bin/ksh -p # ... cmd=`basename $0`
by zwp 10y ago
I too don't see how it is useful but it's certainly a thing. The Solaris implementation looks like this:
#!/bin/ksh -p
# ...
cmd=`basename $0`
$cmd "$@"
I just noticed that the what(1)-string (I haven't seen on of those for a long time) references "alias.sh", perhaps this is a clue?
#ident "@(#)alias.sh 1.2 00/02/15 SMI"
Were builtins actually aliases in an early shell? I still don't understand how this works though.
- tyingq 10y agoThat's a funny implementation. It would end up being an infinite loop for any command that wasn't a builtin, or didn't have an identically named thing higher up the PATH. Like if you renamed it from /usr/bin/cd to /usr/bin/mycd.