Hi forum,
Why does the vertical line work too?
$ echo “foo” | sed -e ‘s/foo/FOO/g’
FOO
$
$ echo “foo” | sed -e ‘s|foo|FOO|g’
FOO
$
$ sed --version
sed (GNU sed) 4.5
Thanks
Hi forum,
Why does the vertical line work too?
$ echo “foo” | sed -e ‘s/foo/FOO/g’
FOO
$
$ echo “foo” | sed -e ‘s|foo|FOO|g’
FOO
$
$ sed --version
sed (GNU sed) 4.5
Thanks
The
/characters may be uniformly replaced by any other single character within any givenscommand. The/character (or whatever other character is used in its stead) can appear in the regexp or replacement only if it is preceded by a\character.