osh$ empty=''
osh$ x='name with spaces.mp3'
This is like Bourne shell: $ argv $empty $x
['name', 'with', 'spaces.mp3'] # omit empty and split
$ argv "$empty" "$x"
['', 'name with spaces.mp3'] # unchanged
Opt into better behavior, also available with bin/oil: $ shopt --set oil:basic
$ argv $empty $x
['', 'name with spaces.mp3'] # no splitting/elision
If you want to omit empty strings, you can use the maybe() function, which returns a 0 or 1 length array for SPLICING with @: $ argv @maybe(empty) "$x"
['name with spaces.mp3'] # omitted empty string
Example of splicing arrays: $ array=("foo $x" '1 2')
$ argv $empty @array
['', 'foo name with spaces.mp3', '1 2']
This is called "Simple Word Evaluation": https://www.oilshell.org/release/latest/doc/simple-word-eval...Feedback appreciated!
(Interestingly zsh also doesn't split words, but it silently removes empty strings).