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/mftl.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/mftl.awk')
-rw-r--r-- | bin/mftl.awk | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/mftl.awk b/bin/mftl.awk index 21976337..1546526d 100644 --- a/bin/mftl.awk +++ b/bin/mftl.awk @@ -31,6 +31,12 @@ BEGIN { FS = "[ \t:]" } # Print unique determined targets, sorted END { - for (t in ats) - print t | "sort" + sort = "" + for (t in ats) { + if (!sort) + sort = "sort" + print t | sort + } + if (sort) + close(sort) } |