我在 bash 脚本中嵌套引号有困难
argv="su -c '$RVM_PATH wrapper $config_rvm \'$PASSENGER_RVM_BIN $command $options\'' web"
eval $argv
上面的内容让我明白了
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"
关于Bash 嵌套引号和 eval,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9510362/