Bash quoted array expansion
WHen I write a bash program I typically construct calls like follows: declare -a mycmd=( command.ext "arg1 with space" arg2 thing etc ) "${mycmd[@]}" || echo "Failed: foo" Where die foo is a bash function that prints Error foo and exits. But if I want to be clear about the error reason, I want to print the failed command: "${mycmd[@]}" || echo "Failed: foo: ${mycmd[*]}" So the user can run the dead command and find out why . However, quoting is lost on this pass - the Failed message arguments that have spaces or escaped characters are not printed in a way that can be cut-n-pasted and run. Does