3 ms·
I find it basically impossible to compose programs where I have things like a list of filenames with spaces. It turns out some programs support some kind of opt
by CJefferson 7y ago
I find it basically impossible to compose programs where I have things like a list of filenames with spaces. It turns out some programs support some kind of option to separate with nulls, but they are inconsistent and not everything supports it.
So I end up having to put everything in one giant call to 'find', which defeats the compositionality of shells.
- cben 7y agoNull-terminated mode: turns out tons of tools have these: https://github.com/fish-shell/fish-shell/issues/3164#issuecomment-354600352 https://github.com/fish-shell/fish-shell/issues/3164#issueco... But yeah, 2nd "standard" hurts compositionality. Default posix/bash splitting of output by spaces is very big-prone and having to type "$array[@]" all over the place is annoying. But splitting by lines is much saner. Now newlines in file names, that's just evil and should be outlawed at OS level. I think OSX did this (?) In bash life can be easier by setting IFS (Google "bash strict mode" though I have reservations about the IFS part). But really, its easy to fix in a non-posix shell. Fish splits by lines and interpolates variables as arrays by default.