diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-08-08 10:49:21 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-08-08 10:50:49 +1200 |
commit | 7128d16de2547125ddec97d9ffe989216674601d (patch) | |
tree | 599dc4e37daeccc4032df0cce7a27ebf754a5fb0 | |
parent | Nicer handling of RFC control chars (diff) | |
download | dotfiles-7128d16de2547125ddec97d9ffe989216674601d.tar.gz dotfiles-7128d16de2547125ddec97d9ffe989216674601d.zip |
Compatible stripping for onl(1df)
-rw-r--r-- | bin/onl.awk | 5 |
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 |