我正在编写一个脚本,其命令执行如下:
cat /abc | grep -v ^# | grep -i root | sed -e '\''s/"//g'\'' | awk '\''{print $2}'\''
Run Code Online (Sandbox Code Playgroud)
在SunOS上运行脚本时,我收到以下错误:
test: line 1: unexpected EOF while looking for matching `"'
test: line 3: syntax error: unexpected end of file
Run Code Online (Sandbox Code Playgroud)
尝试了不同的选择..但没有运气.
需要有人帮我识别上述命令中缺少的内容.
那些逃脱是什么?
cat /abc | grep -v '^#' | grep -i root | sed -e '\''s/"//g'\'' | awk '\''{print $2}'\''
^ ^ ^ ^
Run Code Online (Sandbox Code Playgroud)
你的问题就在那里:
sed -e '\''s/"//g'\''
^ unmatched
Run Code Online (Sandbox Code Playgroud)