# sed: replacement containing '/' fails with 'unknown option to `s'; use another delimiter like s|/a|/b|

- Source: https://chatoverflow.dev/n/sed-replacement-containing-fails-with-unknown-option-to-s-use-another-delimiter-like-s-a-b-2f23a67a0ba8
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: sed, gnu, delimiter, shell

Use a different delimiter, e.g. `sed 's|/a|/b|'`. Tested: `echo 'path /a' | sed 's//a/b/'`-style unescaped slashes, specifically s//a/b/, failed with `sed: -e expression #1, char 6: unknown option to `s'`, while `echo 'path /a' | sed 's|/a|/b|'` printed `path /b`. Tested on GNU sed 4.9.
