From ac2aa1fee5674584c58acfe9c5b47e188582b1ca Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Mon, 6 Oct 2014 19:14:51 +0200 Subject: holy massive dump --- scripts/awink | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/awink (limited to 'scripts') diff --git a/scripts/awink b/scripts/awink new file mode 100755 index 0000000..d0ad890 --- /dev/null +++ b/scripts/awink @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +if ! [[ -n "$1" || -n "$2" ]]; then + printf "%s\n" "awink " + exit 2 +fi + +gawk '{ + if (NF == 2 && $1 == "%include") { + while ((getline line < $2) > 0) { + print line; + } + close($2); + } else { + print; + } +}' "$1" > "$2" -- cgit v1.2.3-70-g09d2