2016-02-16 149 views
0

請幫助下面的錯誤。sed命令:未終止的命令

[email protected]:~$ awk '{print $4}' run.list | sed "s/[[email protected]/''/g" 
sed: -e expression #1, char 17: unterminated `s' command 
[email protected]:~$ awk '{print $4}' run.list | sed 's/"[[email protected]"/''/g' 
sed: -e expression #1, char 17: unterminated `s' command 
[email protected]:~$ awk '{print $4}' run.list | sed 's/"[[email protected]"//g' 
sed: -e expression #1, char 17: unterminated `s' command 
[email protected]:~$ 

謝謝。

+3

括號需要轉義:''s/\ [deployer @ /''/ g「'。 – Amadan

+0

請將其添加爲答案。我會接受,因爲你今天節省了寶貴的時間 –

回答

1

[是一個正則表達式中具有特殊意義的字符。因此,與正則表達式中的任何特殊字符一樣,它需要被轉義:

"s/\[[email protected]/''/g"