shosei

manpath

May 10th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.44 KB | None | 0 0
  1. #!zsh -f
  2. # manpath: my short zsh script to search for man pages whose names contain  
  3. # that argument. Searches all the directories named in your
  4. # "manpath" environment variable.
  5.  
  6. [[ ! -o nonomatch ]] && setopt nonomatch
  7.  
  8. if (($# == 0))
  9. then
  10.     echo $manpath | tr " " "\012"
  11. else
  12.     for dir in $manpath
  13.     do
  14.         for subdir in $dir/man* $dir/cat*
  15.         do
  16.             /bin/ls -l $subdir/*$1*
  17.         done
  18.     done |& egrep -v '([Nn]o(t found| such|t a))'
  19. fi
Advertisement
Add Comment
Please, Sign In to add comment