3 ms·
As per my original comment, literally any separator other than NUL (or slash if you're only ever dealing with filenames, not paths, even though that would be he
by l0b0 6y ago
As per my original comment, literally any separator other than NUL (or slash if you're only ever dealing with filenames, not paths, even though that would be hella confusing) breaks with some filenames. Just use NUL.
- eMSF 6y agoWith the given options, ls is no longer trying to separate "raw" filenames with any character. Rather, it encodes them unambiguously, and hence we can parse the newline-separated output just fine. You can see the same "trick" used in one of the links of your first comment (the one that warns against parsing ls output).