2 # whatis -- and implementation of the 10th Edition Unix sh builtin `whatis'
5 # usage: whatis arg [...]
7 # For each argument, whatis prints the associated value as a parameter,
8 # builtin, function, alias, or executable file as appropriate. In each
9 # case, the value is printed in a form which would yield the same value
10 # if typed as input to the shell itself.
15 local wusage='usage: whatis arg [arg...]'
18 if [ $# -eq 0 ] ; then
25 case $(builtin type -type $arg 2>/dev/null) in
30 builtin type "$arg" | sed 1d
36 builtin type -path "$arg"
39 # OK, we could have a variable, or we could have nada
40 if [ "$(eval echo \${$arg+set})" = "set" ] ; then
41 # It is a variable, and it is set
43 eval echo '\"'\$$arg'\"'
45 echo whatis: $arg: not found