Mercurial > repo
changeset 8703:e5b2b5eda9fe
<oerjan> ` chmod +x she*; mv she* bin
author | HackBot |
---|---|
date | Tue, 05 Jul 2016 02:21:21 +0000 |
parents | e91970e62be1 |
children | 71922bacd183 |
files | bin/shebang_args_or_input shebang_args_or_input |
diffstat | 2 files changed, 1 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/shebang_args_or_input Tue Jul 05 02:21:15 2016 +0000 +++ b/bin/shebang_args_or_input Tue Jul 05 02:21:21 2016 +0000 @@ -1,2 +1,2 @@ #!/bin/bash -interp="$1"; script="$2"; shift 2; if [ "$#" -eq 1 ]; then printf '%s\n' "$1"; else cat; fi | { shift; $interp "$script" "$@"; } +interp="$1"; script="$2"; shift 2; if [ "$#" -eq 1 ]; then printf '%s\n' "$1"; elif [ "$#" -eq 0 ]; then cat; fi | { shift; $interp "$script" "$@"; }