diff options
Diffstat (limited to 'bin/shb')
-rwxr-xr-x | bin/shb | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -3,15 +3,14 @@ self=shb # Need at least two arguments -if [ "$#" -lt 2 ] ; then - printf >&2 '%s: Need input file and command\n' "$self" +if [ "$#" -lt 1 ] ; then + printf >&2 '%s: Need interpreter command\n' "$self" exit 1 fi -# First argument is the script (might be - for stdin), second argument is the -# name of the interpreter -scr=$1 intn=$2 -shift 2 +# First argument is the name of the interpreter +intn=$1 +shift # Try and find the path to the interpreter command, bail out if we can't if ! intp=$(command -v "$intn" 2>/dev/null) ; then @@ -25,4 +24,4 @@ set -- "$intp" "$@" printf '#!%s\n' "$*" # Emit the rest of the input -cat -- "$scr" +cat |