3 ms·
The thing that always irritates me about bash is trying to use nulls as separators so you can run over many files without breaking on spaces or other characters
by brokenmachine 3y ago
The thing that always irritates me about bash is trying to use nulls as separators so you can run over many files without breaking on spaces or other characters in the filenames.
Is it -0 --null, -zero or -z?? Who knows? And every app has a different option. Only a grizzled old greybeard would remember.
- cben 3y agoA list I built once of such options for commands: https://github.com/fish-shell/fish-shell/issues/3164#issuecomment-354600352 https://github.com/fish-shell/fish-shell/issues/3164#issueco... You are right, very little consistency :-( In some cases you really need the \0 delimiters for safety, but a large portion of safe scripting in shells is merely about handling arrays of strings, without joining nor splitting them on whitespace. bash does have arrays and "${array[@]}" syntax but it's pretty horrible (and needs the `shellcheck` linter to keep right). Some more modern shells e.g. `fish` do much better on this.