view bin/shebang_args_or_input @ 11992:be5cdff45ee9 draft

<ais523> delquote 232
author HackEso <hackeso@esolangs.org>
date Thu, 24 Oct 2019 22:14:10 +0000
parents c989a1669243
children
line wrap: on
line source

#!/bin/bash
interp="$1"; script="$2"; shift 2; if [ "$#" -eq 1 ]; then printf '%s\n' "$1"; elif [ "$#" -eq 0 ]; then cat; fi | { shift; $interp "$script" "$@"; }