Search code examples
seddelimiter

sed rare-delimiter (other than & | / ?...)


I am using the Unix sed command on a string that can contain all types of characters (&, |, !, /, ?, etc).

Is there a complex delimiter (with two characters?) that can fix the error:

sed: -e expression #1, char 22: unknown option to `s'

Solution

  • There is no such option for multi-character expression delimiters in sed, but I doubt you need that. The delimiter character should not occur in the pattern, but if it appears in the string being processed, it's not a problem. And unless you're doing something extremely weird, there will always be some character that doesn't appear in your search pattern that can serve as a delimiter.