В чём отличие между
1) $var
2) "$var"
3) ${var}
4) "${var}"
а так же
1) $( cmd )
2) "$( cmd )"
Что означает "Pathname expansion" в этом куске из мана:
The parameter name or symbol can be enclosed in braces, which are optional except for positional parameters with more than one digit or
when parameter is followed by a character that could be interpreted as part of the name. If a parameter expansion occurs inside double-
quotes:
1. Pathname expansion is not performed on the results of the expansion.
2. Field splitting is not performed on the results of the expansion, with the exception of @.
???