${(Q)…}
: Remove one level of quotes
Q
removes one level of quotes from the resulting words.
Links
Examples
- Remove quotes
- Output:
1 2 3 4 5 6
double_quoted="\"'double quoted string'\"" echo ${double_quoted} # remove one level of quotes echo ${(Q)double_quoted} # remove two levels of quotes echo ${(Q)${(Q)double_quoted}}
1 2 3
"'double quoted string'" 'double quoted string' double quoted string
BashSupport Pro is a Zsh IDE with support for ${(Q)…} – try it now!