aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-01-05 19:17:50 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-01-05 19:17:50 +1300
commit93e5ccdd9a47dbab0e7db92fba25352665b68bf7 (patch)
tree9f26fe8008d7716aa9e96929d90e6db4779c179d /bin
parentAdopt much simpler approach for onl(1df) (diff)
downloaddotfiles-93e5ccdd9a47dbab0e7db92fba25352665b68bf7.tar.gz
dotfiles-93e5ccdd9a47dbab0e7db92fba25352665b68bf7.zip
Slightly more idiomatic awk
Diffstat (limited to 'bin')
-rw-r--r--bin/onl.awk4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/onl.awk b/bin/onl.awk
index c12039db..10daafed 100644
--- a/bin/onl.awk
+++ b/bin/onl.awk
@@ -8,8 +8,8 @@
# Print each field, without a newline; add a leading space if it's not the
# very first one
for (i = 1; i <= NF; i++)
- printf (f++) ? " %s" : "%s", $i
+ printf (f++) ? OFS "%s" : "%s", $i
}
# Print a newline to close the line
-END { printf "\n" }
+END { print "" }