concept
Bash command array
Uses the first element as the command name and remaining elements as separate arguments. The command must be trusted; shell syntax in an element is not reparsed.
Formal Syntax & Structure
bash syntaxbash
"${cmd[@]}"Return Value
exit status
Uses the first element as the command name and remaining elements as separate arguments. The command must be trusted; shell syntax in an element is not reparsed.
Working Example
Example Snippetbash
cmd=(printf '%s\n')cmd+=('a; b' '*' '$(date)' '>')"${cmd[@]}"