aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-08-08 10:49:21 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-08-08 10:50:49 +1200
commit7128d16de2547125ddec97d9ffe989216674601d (patch)
tree599dc4e37daeccc4032df0cce7a27ebf754a5fb0 /bin
parentNicer handling of RFC control chars (diff)
downloaddotfiles-7128d16de2547125ddec97d9ffe989216674601d.tar.gz
dotfiles-7128d16de2547125ddec97d9ffe989216674601d.zip
Compatible stripping for onl(1df)
Diffstat (limited to 'bin')
-rw-r--r--bin/onl.awk5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/onl.awk b/bin/onl.awk
index 15e4f46d..89469f3c 100644
--- a/bin/onl.awk
+++ b/bin/onl.awk
@@ -2,8 +2,9 @@
# For each line of input ...
{
- # Strip out whitespace characters and rebuild the fields
- gsub(/[\n\t\r ]+/, "")
+ # Replace groups of spaces and control characters with one space,
+ # implicitly re-splitting the fields
+ gsub(/[\a\b\f\n\r\t\v ]+/, " ")
# Print each field, without a newline; add a leading space if it's not the
# very first one