home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d8xx / d811 / bsh.lha / bsh / whatis < prev    next >
Text File  |  1993-02-14  |  1KB  |  31 lines

  1. local ___i ___n IFS="\n"
  2. if !?$1
  3.     # a possible array of strings is combined into a single string by
  4.     # quoting the substitution.  Double quotes are required for this
  5.     # to work, since no command substitution occurs between single
  6.     # quotes.
  7.     set ___i "`alias $1`" >NIL:
  8.     if strlen(___i)
  9.     echo "$1 is an alias, value = \"$___i\""
  10.     else
  11.     set ___i "`hash $1`" >NIL:
  12.     if strlen(___i)
  13.         echo "$1 is a hashed command, value = \"$___i\""
  14. #    elseif `echo $?$1`
  15. #        echo "$1 is an environment variable, value = \"`echo $1`\""
  16.     else
  17.         echo "$1 is undefined"
  18.     endif
  19.     endif
  20. elseif ___n = \#$1
  21.     echo "$1 is an array, of $___n elements, value = "
  22.     ___i = 0
  23.     repeat ___n 'echo "${1}[$___i] = \"`set ${1}[$___i]`\"";___i++'
  24. else
  25.     echo "$1 is a simple variable, value = \"`set $1`\""
  26. endif
  27. # Whatis is presented as is; no warrantee is either expressed or implied
  28. # as to it's suitability to any purpose whatsoever.  You assume all the
  29. # risk for all damage, even if caused by a defect in the software,
  30. # no matter how awful.
  31.