zsh Main differences from bash Differences in quoting


Example

In bash, you have to quote arguments in order to preserve white space:

# bash

function print_first_argument {
    echo "$1"
}

argument="has white space"
print_first_argument "$argument"

In Zsh, you don't need the quotes, because of different evaluation order:

# zsh

function print_first_argument {
    echo $1
}

argument="has white space"
print_first_argument $argument