X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=usr_bin%2Fgrml-exec-wrapper;h=d3ff8eeec350613c0a38ddfaca2f608fdf3bef49;hb=2378c65d20e15a10d3a062fd75bc54f205eacc61;hp=6973b7053bda2d492a800c621950f69ff781d607;hpb=53d5cac317a6a56e1dfcf37344ed1e2484521f33;p=grml-scripts.git diff --git a/usr_bin/grml-exec-wrapper b/usr_bin/grml-exec-wrapper index 6973b70..d3ff8ee 100755 --- a/usr_bin/grml-exec-wrapper +++ b/usr_bin/grml-exec-wrapper @@ -13,14 +13,20 @@ Available options: -h | --help display this usage information -p check specified argument instead of default args, like: - $(basename $0) -p aumix xterm -T aumix -e aumix + $(basename $0) -p aumix xterm -T aumix -e aumix " } is_installed() { - prog="$(basename $1)" + prog="$1" [ -z "$prog" ] && return 1 + case "${prog}" in + /*) # deal with absolute-path programs + [ -x "${prog}" ] && return 0 + return 1 ;; + esac + ret=1 oifs="$IFS" IFS=: @@ -51,10 +57,10 @@ fi if [ "$1" = '-p' ] ; then if [ -z "$2" ] ; then usage - exit 1 + exit 1 else PROG="$2" - shift ; shift + shift ; shift fi else PROG="$1"