patch-2.2.18 linux/scripts/kwhich

Next file: linux/scripts/mkdep.c
Previous file: linux/scripts/ksymoops/ksymoops.c
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/scripts/kwhich linux/scripts/kwhich
@@ -0,0 +1,24 @@
+# kwhich 1.0 (C) 2000 Miquel van Smoorenburg
+# This program is GPLed
+
+if [ $# -lt 1 ]
+then
+        echo "Usage: $0 cmd [cmd..]" >&2
+        exit 1
+fi
+
+IFS=:
+for cmd in $*
+do
+        for path in $PATH
+        do
+                if [ -x "$path/$cmd" ]
+                then
+                        echo "$path/$cmd"
+                        exit 0
+                fi
+        done
+done
+
+echo "$*: not found" >&2
+exit 1

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)