Support passing of binary commands to their "g*" equivs on Solaris.
authorshort <>
Tue, 17 Feb 2004 17:17:06 +0000 (17:17 +0000)
committershort <>
Tue, 17 Feb 2004 17:17:06 +0000 (17:17 +0000)
 - ar(1) is not alias-able or function-able by shell through make(1).

bin/ar [new file with mode: 0755]
bin/passg [new file with mode: 0755]

diff --git a/bin/ar b/bin/ar
new file mode 100755 (executable)
index 0000000..70cf013
--- /dev/null
+++ b/bin/ar
@@ -0,0 +1,2 @@
+#! /bin/bash
+exec passg "$0" "$@"
diff --git a/bin/passg b/bin/passg
new file mode 100755 (executable)
index 0000000..4b63335
--- /dev/null
+++ b/bin/passg
@@ -0,0 +1,15 @@
+#! /bin/sh
+arg0="$1"
+shift
+me="`basename "$arg0"`"
+# FIXME: Why not: IFS=: for i in...
+save_IFS="$IFS"
+IFS=:
+for i in $PATH;do
+       IFS="$save_IFS"
+       test -x "$i/$me" -a "$i/$me" != "$arg0" || continue
+       exec "$i/$me" "$@"
+       echo "NOTREACHED" && exit 1
+       done
+IFS="$save_IFS"
+exec "g$me" "$@"