diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-07-02 17:36:37 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-07-02 22:57:07 +1200 |
commit | 95276f25769a0607cda50041169197d0522b98ff (patch) | |
tree | 3a4738901390c94f76de6ee7b6394d39b4c1ed00 /bin/mi5.awk | |
parent | Coerce seed to number (diff) | |
download | dotfiles-95276f25769a0607cda50041169197d0522b98ff.tar.gz dotfiles-95276f25769a0607cda50041169197d0522b98ff.zip |
Lots of cleanup of awk scripts
Mostly inspired by suggestions from gawk --lint
Diffstat (limited to 'bin/mi5.awk')
-rw-r--r-- | bin/mi5.awk | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/bin/mi5.awk b/bin/mi5.awk index 48d71657..7acb6f3b 100644 --- a/bin/mi5.awk +++ b/bin/mi5.awk @@ -4,19 +4,14 @@ BEGIN { # You can change any of these, but while changing these is still relatively # sane... - if (!length(open)) - open = "<%" - if (!length(shut)) - shut = "%>" + open = "<%" + shut = "%>" # ... changing these probably isn't, and should compel you to rethink your # code, or quite possibly your entire life thus far. - if (!length(quote)) - quote = "`" - if (!length(unquote)) - unquote = "'" - if (!length(dnl)) - dnl = "dnl" + quote = "`" + unquote = "'" + dnl = "dnl" # We do not start in a block bmac = 0 @@ -24,7 +19,9 @@ BEGIN { # Fatal error function function fatal(str) { - printf "%s: %s\n", self, str | "cat >&2" + stderr = "cat >&2" + printf "%s: %s\n", self, str | stderr + close(stderr) exit(1) } |