aboutsummaryrefslogtreecommitdiffstats
path: root/which
diff options
context:
space:
mode:
Diffstat (limited to 'which')
-rwxr-xr-xwhich11
1 files changed, 11 insertions, 0 deletions
diff --git a/which b/which
new file mode 100755
index 0000000..473c891
--- /dev/null
+++ b/which
@@ -0,0 +1,11 @@
+#!/bin/sh
+arg=$1
+for d in `echo $PATH | sed -e 's/:/ /g'`
+do
+ if [ -x $d/$arg ]; then
+ echo $d/$arg
+ exit 0
+ fi
+done
+echo "${arg}: Command not found."
+exit 1