Bash nested quotes and eval
I'm having difficulty nested quotes within a bash script argv="su -c '$RVM_PATH wrapper $config_rvm \'$PASSENGER_RVM_BIN $command $options\'' web" eval $argv The above got me eval: line 162: unexpected EOF while looking for matching `'' eval: line 163: syntax error: unexpected end of file argv="su -c \"$RVM_PATH wrapper $config_rvm \\\"$PASSENGER_RVM_BIN $command $options\\\"\" web" That's because \' doesn't have any special meaning within a single-quoted string; it means simply "backslash, followed by end-of-string". One option is to use $'...' instead of '... '; that will let you use