diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-06-02 18:28:57 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-06-02 18:28:57 +1200 |
commit | 56c8ada346bde4ea44e199020c03afd731727bd6 (patch) | |
tree | 65846ea2ea00eeb2bae3d008c9e0ab405a3f66d6 /bin/rfct.awk | |
parent | Add skip-pager to ~/.my.cnf (diff) | |
download | dotfiles-56c8ada346bde4ea44e199020c03afd731727bd6.tar.gz dotfiles-56c8ada346bde4ea44e199020c03afd731727bd6.zip |
Simplify some awk
Diffstat (limited to 'bin/rfct.awk')
-rw-r--r-- | bin/rfct.awk | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/bin/rfct.awk b/bin/rfct.awk index 256841a7..4467f206 100644 --- a/bin/rfct.awk +++ b/bin/rfct.awk @@ -6,11 +6,8 @@ BEGIN { ORS = "\n\n" } -{ - # Strip out control characters, except tab and newline - gsub(/[^[:print:]\n\t]/, "") +# Strip out control characters, except tab and newline +{ gsub(/[^[:print:]\n\t]/, "") } - # If there's anything left, print it - if (length) - print -} +# If there's anything left, print it +length($0) |