Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unexpected EOF while looking for matching `"'

Tags:

unix

sed

awk

I am writing a script which has command to execute as below:

cat /abc | grep -v ^# | grep -i root  | sed -e '\''s/"//g'\'' | awk '\''{print $2}'\''

When running the script on SunOS, i am getting below error:

test: line 1: unexpected EOF while looking for matching `"'
test: line 3: syntax error: unexpected end of file

Tried with different option.. but no luck.

Need somebody help me identify what is missing in the above command.

like image 537
Mrun Avatar asked Sep 14 '11 10:09

Mrun


1 Answers

what are those escapes ?!

cat /abc | grep -v '^#' | grep -i root | sed -e '\''s/"//g'\'' | awk '\''{print $2}'\''
                                                 ^         ^          ^             ^

Your problem is there:

sed -e '\''s/"//g'\''
             ^ unmatched
like image 90
c00kiemon5ter Avatar answered Nov 20 '22 18:11

c00kiemon5ter