Skip to main content
10 events
when toggle format what by license comment
May 6, 2020 at 18:35 comment added JamesTheAwesomeDude It appears that { ($cmd 2>&3 3>&-) | perl -0777 -pe '' 3>&- ; } 3>&1 works perfectly.
May 6, 2020 at 12:42 history edited Stéphane Chazelas CC BY-SA 4.0
deleted 1 character in body
May 5, 2020 at 6:58 comment added Kamil Maciorowski Now I see a broader picture. After reading the definition of "shall" I understand "input files shall be text files" does not imply "non-text files may be unsupported because they don't meet the requirement". It means "the utility must support text files and may still be obliged to support (some) other files". So "input files shall" is not about the files, it's about the utility. In particular for awk "input files shall be text files", still RS may be something else than a newline, so the input may totally not comply with the formal definitions of "text file" and "line". Lesson learned.
May 5, 2020 at 5:58 comment added Stéphane Chazelas @KamilMaciorowski, you're making very good points, and I've incorporated some in my answer. A note however: though some awk implementations will choke on NUL and extra-long lines, they are required do deal with non-delimited lines.
May 5, 2020 at 5:55 history edited Stéphane Chazelas CC BY-SA 4.0
added 433 characters in body
May 5, 2020 at 5:21 history edited Stéphane Chazelas CC BY-SA 4.0
added 1938 characters in body
May 4, 2020 at 19:05 comment added JamesTheAwesomeDude This is really, really close to being a perfect/correct solution. Does sh not contain any builtins, or POSIX prescribe any similar functions, to mimic awk's functionality here, but without interfering in the text?
May 4, 2020 at 18:56 review Suggested edits
May 5, 2020 at 2:44
May 4, 2020 at 17:33 history edited Stéphane Chazelas CC BY-SA 4.0
added 189 characters in body
May 4, 2020 at 17:08 history answered Stéphane Chazelas CC BY-SA 4.0