4 ms·
I would agree. It would be nice to see a new shell (that isn't PowerShell) that worked well with spaces in file names.
by ape4 3y ago
I would agree. It would be nice to see a new shell (that isn't PowerShell) that worked well with spaces in file names.
- nerdponx 3y agoZsh works fine with spaces and all other manner of weird whitespace, non-printable binary data, etc. The only unfortunate edge case where are you still need to quote things defensively is if a parameter is completely empty, then the entire word gets removed from the command if the expansion is not quoted. Other shells are fun, but Z Shell already solved all the worst problems of parameter expansion years ago. If anything, you should be migrating your Bash scripts to Zsh even if you never switch your interactive shell. That said, most of the problems here don't have much to do with parameter expansion and have more to do with the fact that text as a universal interface kind of sucks. Nushell and Powershell have better models here, but the latter lacks a convenient way to parse fixed-width tables so it's unfortunately frustrating to use with a lot of traditional Unix tools (there's no "ConvertFrom-Table" cmdlet, only "ConvertFrom-CSV").
- ElectricalUnion 3y ago> Zsh works fine with spaces and all other manner of weird whitespace, non-printable binary data, etc. > most of the problems here don't have much to do with parameter expansion Parameter expansion is 99% of the problem here as you said youself. Parameter expansion ends up being most of the time what other script languages would call eval, and everyone knows to avoid eval unless you really need to use it. Excluding some really annoying bugs, almost all shells works fine for any sort of binary data. It's the user shell script that is composed of unsafe word expansions that doesn't. It just takes someone messing with parameter expansion in zsh (SH_WORD_SPLIT) and then zsh becomes just another shell in a world of hurt again.