1

I am trying to use sed to find a replace "Host" with "Europe/London", however it is failing as shown below:

# sed -i -e 's/"Host"/"Europe/London"/g' /usr/local/php73/lib/php.ini
sed: -e expression #1, char 18: unknown option to `s'

What am I doing wrong here?

1 Answers1

3

Your replacement text contains /, which sed is treating as end-of-expression and then failing on the next character.

Either change the delimiter from / to something that doesn't appear in either the pattern match or its replacement text, or escape the character with a backslash:

s/"Host"/"Europe\/London"/g
s#"Host"#"Europe/London"#g
Chris Davies
  • 116,213
  • 16
  • 160
  • 287