On Jul 20, 10:02 pm, pac...@kosh.dhis.org (Alan Curry) wrote:
> In article
> ,
>
> Toby wrote:
> >Hi,
>
> >I would like to replace a a set of words by another word via sed. My
> >first try was:
>
> > echo "a cat or a dog" | sed 's/\(cat\)\|\(dog\)/PET/g'
>
> >I also tried some variations of thi
Hi,
I would like to replace a a set of words by another word via sed. My
first try was:
echo "a cat or a dog" | sed 's/\(cat\)\|\(dog\)/PET/g'
I also tried some variations of this. But all failed.
For any help I would be very happy.
Cheers,
Toby
P.S. some variations of the search pattern
\(
In article ,
Toby wrote:
>Hi,
>
>I would like to replace a a set of words by another word via sed. My
>first try was:
>
> echo "a cat or a dog" | sed 's/\(cat\)\|\(dog\)/PET/g'
>
>I also tried some variations of this. But all failed.
Works for me:
$ echo "a cat or a dog" | sed 's/\(cat\)\|\(do