]>
diplodocus.org Git - nmh/blob - etc/mhn.find.sh
3 # mhn.find.sh -- check if a particular command is available
7 echo "usage: mhn.find.sh search-path program" 1>&2
11 # PATH to search for programs
14 # program to search for
17 PGM
= oIFS
="$IFS" IFS
=":"
18 for A
in $SEARCHPATH; do
20 # skip the directories `.' and `..'
21 if test "$A" = "." -o "$A" = ".."; then
25 # if program was found in /usr/local/bin, then
26 # just echo program name, else echo full pathname
27 if test -f "$A/$PROGRAM"; then
28 if test "$A" = "/usr/local/bin"; then