5 ms·
Speaking with my fish developer hat on: The only common case where we find that splitting on spaces is actually needed is pkg-config and related tools, because
by faho 5y ago
Speaking with my fish developer hat on:
The only common case where we find that splitting on spaces is actually needed is pkg-config and related tools, because that prints flags to be passed to the compiler, and it does it with spaces so it looks nicer and copy-pasteable:
$ pkg-config --libs gio-2.0
-lgio-2.0 -lgobject-2.0 -lglib-2.0
(ideally, it would simply use newlines here, which bash et al would also split on)
Typically, the easy workaround is `string split " "`:
> somecommand (pkg-config --libs gio-2.0 | string split " ")
Otherwise, this is quite rare in practice. Most unix tools already operate on a line-by-line basis, which allows them to be easily greppable.