system("sed -i 's/wait_process/wait \${a} \&\& wait \${b}/g' xxx.sh");
这么写会出现错误,达不到sed预期的替换效果,即“\&”在sed中写的是"&"。perl发生一次转义、sed也需要一次转义;
system("sed -i 's/wait_process/wait \${a} \\&\\& wait \${b}' xxx.sh");
需要使用两次\转义符