diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-05 19:17:50 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-05 19:17:50 +1300 |
commit | 93e5ccdd9a47dbab0e7db92fba25352665b68bf7 (patch) | |
tree | 9f26fe8008d7716aa9e96929d90e6db4779c179d /bin/onl.awk | |
parent | Adopt much simpler approach for onl(1df) (diff) | |
download | dotfiles-93e5ccdd9a47dbab0e7db92fba25352665b68bf7.tar.gz dotfiles-93e5ccdd9a47dbab0e7db92fba25352665b68bf7.zip |
Slightly more idiomatic awk
Diffstat (limited to 'bin/onl.awk')
-rw-r--r-- | bin/onl.awk | 4 |
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 "" } |