Reputation: 379
Getting sed: -e expression #1, char 7: unterminated `s' command
in bash script
Here is snippet:
que=`cat temp | grep -o -P '(?<=uid").*(?=text)' | sed -e 's/\\/ /g' | sed -e 's/["]//g' | cut -d ":" -f3 | cut -d "," -f1`
I searched some other answers on here but none of helped.
Upvotes: 3
Views: 2100
Reputation: 17751
The problem is this:
sed -e 's/\\/ /g'
Because it's inside backticks, the \\
is being replaced with \
. You need to double-escape it:
sed -e 's/\\\\/ /g'
Upvotes: 3