#! /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 >&2 "NOTREACHED" && exit 1 done IFS="$save_IFS" exec "g$me" "$@"