Re: Sed programming question

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

 




Dan Thurman wrote:
> Kevin Martin wrote:
>>
>> 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
>>   
> No.  The result should be: (foo AND har) = (1&0)=0
> so the inside nested brackets should not be allowed to
> run and the original string (foo har) is returned.
>
> Dan
>
Ah, I missed the first part of the conversation where it was explained
what you were doing (ah, snipped mail).  Sorry for butting in.

Kevin

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux