diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-03-18 07:25:36 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-03-18 07:25:36 -0700 |
commit | f315ee7e35eee5cba24ed71c646ecdfd37a4ba27 (patch) | |
tree | 9fc8f066a0304e02405156ef4eb8215f2ac6651a | |
parent | 4171b13bd8659819badea73d338ab194c1a08d1f (diff) | |
download | cppawk-f315ee7e35eee5cba24ed71c646ecdfd37a4ba27.tar.gz cppawk-f315ee7e35eee5cba24ed71c646ecdfd37a4ba27.tar.bz2 cppawk-f315ee7e35eee5cba24ed71c646ecdfd37a4ba27.zip |
Remove hash-bang lines from awk code.
-rwxr-xr-x | cppawk | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -37,6 +37,7 @@ awk_file= awk_opts= prepro_opts= tmp_file= +delhashbang="sed -e /^#!/d" # functions shell_escape() @@ -107,11 +108,13 @@ trap 'rm -f $tmp_file' EXIT INT TERM if [ -n "$awk_file" ] ; then tmp_file=$(mktemp) - $prepro $prepro_opts "$awk_file" > $tmp_file + $delhashbang "$awk_file" | $prepro $prepro_opts - > $tmp_file $awk $awk_opts -f $tmp_file "$@" elif [ $# -gt 0 ] ; then tmp_file=$(mktemp) - printf "%s" "$1" | $prepro $incopt"$(pwd)" $prepro_opts - > $tmp_file; shift + printf "%s" "$1" | $delhashbang | \ + $prepro $incopt"$(pwd)" $prepro_opts - > $tmp_file + shift $awk $awk_opts -f $tmp_file "$@" else die "awk code must be specified" |