[Lubuntu] sed error: -e expression ... unterminated `s' command

John Hupp lubuntu at prpcompany.com
Thu Dec 6 17:31:10 UTC 2012

If I run a script with this command (should search somefile and 
substitute "UPSCABLE ether" for "UPSCABLE usb" wherever it is found):

     sed -i  -e 's/UPSCABLE usb/UPSCABLE ether' <somefile>

It produces the error:

     sed: -e expression #1, char 29: unterminated `s' command

A web search seems to indicate that this is a problem with special 
characters needing to be escaped.

I tried:

     sed -i  -e 's\/UPSCABLE usb\/UPSCABLE ether' <somefile>

But that simply produces:

     sed: -e expression #1, char 31: unterminated `s' command

Anyone know how to fix this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/lubuntu-users/attachments/20121206/15f5235d/attachment.html>

More information about the Lubuntu-users mailing list