[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Sed programming question





Gordon Messmer wrote:
> Dan Thurman wrote:
>> I tested your suggestion above with and without -r option
>> but could not make it work as an "AND operator":
>>
>> # echo "foo har" | sed -re '/foo/{/bar/{s/foo/goo/}}'
>> goo har
>
> $ rpm -q sed
> sed-4.1.5-11.fc10.x86_64
>
> $ echo "foo har" | sed -re '/foo/{/bar/{s/foo/goo/}}'
> foo har
>

$ echo "foo har"  | sed -e "s/foo/goo/g" -e "s/har/bar/g"
goo bar

Is this what you're trying to do?

Kevin


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]