lookman 376 B

12345678910111213141516171819
  1. #!/dis/sh
  2. load std
  3. fn cmdform {
  4. sed 's;/man/;;
  5. s;(.*)/(0intro);man \1 \2 # intro(\1);
  6. s;(.*)/(.*);man \1 \2 # \2(\1);'
  7. }
  8. post=cmdform
  9. x=$*
  10. ~ $1 -f && {
  11. post=cat
  12. x=${tl $x}
  13. }
  14. x=`{echo $x|tr A-Z a-z|tr -dc 'a-z0-9_ \012'} # fold case, delete funny chars
  15. ~ $#x 0 && {echo Usage: lookman key ... >[1=2]; exit usage}
  16. look $x /man/index | sed 's/^.* //' |sort |uniq | $post