2007-03-07 18:38:31 +03:00
|
|
|
#!/bin/sh -f
|
2007-03-03 17:42:06 +03:00
|
|
|
RC=""
|
2007-04-20 07:27:26 +04:00
|
|
|
IFS=:
|
2008-01-18 01:50:35 +03:00
|
|
|
for i in "$PLAN9" `echo "P9PATHS"`; do
|
2007-03-03 17:42:06 +03:00
|
|
|
if [ -d "$i" -a -x "$i/bin/rc" ]; then
|
2007-03-22 07:52:14 +03:00
|
|
|
export PLAN9="$i"
|
2007-03-03 17:42:06 +03:00
|
|
|
RC="$i/bin/rc"
|
|
|
|
break;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2008-01-18 01:50:35 +03:00
|
|
|
if [ -z "$RC" ]; then
|
2007-03-03 17:42:06 +03:00
|
|
|
exit 1
|
2007-03-22 07:52:14 +03:00
|
|
|
fi
|
|
|
|
|
2008-01-14 23:42:21 +03:00
|
|
|
if [ ! -x "$PLAN9/bin/read" ]; then
|
|
|
|
echo 1>&2 $0: Found rc, but not read'(1)'. You probably have an out-of-date 9base installed.
|
|
|
|
fi
|
|
|
|
|
2007-03-22 07:52:14 +03:00
|
|
|
if [ -n "$1" ]; then
|
2007-04-20 07:27:26 +04:00
|
|
|
exec "$RC" "$@"
|
2007-03-15 22:38:18 +03:00
|
|
|
else
|
|
|
|
true
|
|
|
|
fi
|