From f315ee7e35eee5cba24ed71c646ecdfd37a4ba27 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 18 Mar 2022 07:25:36 -0700 Subject: Remove hash-bang lines from awk code. --- cppawk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cppawk b/cppawk index cdff59e..7911908 100755 --- a/cppawk +++ b/cppawk @@ -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" -- cgit v1.2.3