3 ms·
Zsh does not split words by default, so you don't need to quote everything. This is the main reason I switch to Zsh instead of Bash when there I need a bit more
by vbernat 3y ago
Zsh does not split words by default, so you don't need to quote everything. This is the main reason I switch to Zsh instead of Bash when there I need a bit more than the base shell.
- frizlab 3y agoOoooh I did not know that. I’m so used to quoting everything I won’t stop anyway, but it’s good to know.
- pxeger1 3y agoI can't exactly remember but I think there are a few rare circumstances where you still have to quote things. Inside ${} maybe?
- tuukkah 3y agoAccording to this, it does not happen when you use variables (unless you explicitly ask for it), but it does happen on the output of the command substitution: > A command enclosed in parentheses preceded by a dollar sign, like `$(...)', or quoted with grave accents, like ``...`', is replaced with its standard output, with any trailing newlines deleted. If the substitution is not enclosed in double quotes, the output is broken into words using the IFS parameter. https://www.csse.uwa.edu.au/programming/linux/zsh-doc/zsh_15.html https://www.csse.uwa.edu.au/programming/linux/zsh-doc/zsh_15...
- vbernat 3y agoI don't think there is an exception. Zsh still applies word splitting on process substitution (I suppose this is more natural here).
- tuukkah 3y agoThe way you put it, it does sound like an exception. But what I read, it does not seem to apply on process (or any other) substitution but on the output of command substitution (see under your sibling comment).