@vaporeon_ oh wow, posix xargs doesn’t suppurrt using null characters as a sepurrator
@vaporeon_ exactly
@aescling Personally my opinion is that if you put a newline inside a filename, you deserve whatever troubles this causes you... It's just a wrong thing to do, even if it's technically allowed...
But I understand that not everyone may agree with that.
@vaporeon_ @aescling This has happened before by accident as a result of trying to operate on text files/scripts that were saved in windows notepad.
@onfy @vaporeon_ this succinctly raises so many questions lol, i love it
@aescling @vaporeon_ One thing we did was a script that would take every line in a text file and make an empty file named for it
Say the document says:
Super Mario Bros
Luigi's Mansion
Sonic the Hedgehog 2
After the last character of every line it would have a newline characters because bash assumes Linux line endings instead of windows
So you get a file named Super Mario Bros[CR].
@vaporeon_ @onfy except now it’s not POSIX ;3
@aescling @onfy Good news! I went and checked POSIX 2024 instead of POSIX 2004, and that actually specifies the -0 option, too: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/xargs.html
@vaporeon_ @onfy better late than never ig
@vaporeon_ @onfy good
@aescling @onfy Yeah :(
Do any of the smart people on here ( @alas ) know how you'd get around this problem using only POSIX-standard tools?