aboutsummaryrefslogtreecommitdiff
path: root/bin/trs.awk
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-07-02 17:36:37 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-07-02 22:57:07 +1200
commit95276f25769a0607cda50041169197d0522b98ff (patch)
tree3a4738901390c94f76de6ee7b6394d39b4c1ed00 /bin/trs.awk
parentCoerce seed to number (diff)
downloaddotfiles-95276f25769a0607cda50041169197d0522b98ff.tar.gz
dotfiles-95276f25769a0607cda50041169197d0522b98ff.zip
Lots of cleanup of awk scripts
Mostly inspired by suggestions from gawk --lint
Diffstat (limited to 'bin/trs.awk')
-rw-r--r--bin/trs.awk6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/trs.awk b/bin/trs.awk
index 58fdf8a9..fbb7eeba 100644
--- a/bin/trs.awk
+++ b/bin/trs.awk
@@ -18,8 +18,10 @@ BEGIN {
}
# Bailout function
-function fail(str) {
- printf "%s: %s\n", self, str | "cat >&2"
+function fail(msg) {
+ stderr = "cat >&2"
+ printf "%s: %s\n", self, msg | stderr
+ close(stderr)
exit(2)
}