For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > August 2005 > sed again









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author sed again
Bob

2005-08-23, 3:57 am

What if I have a more complex sed that has ' in it how can I put the sed
into a bourne script becuase ' means something different in a bourne script?


Pascal Bourguignon

2005-08-23, 3:57 am

"Bob" <bob_then@yahoo.com.au> writes:
> What if I have a more complex sed that has ' in it how can I put the sed
> into a bourne script becuase ' means something different in a bourne script?


Using an escape or a double-quote:

[pjb@thalassa tmp]$ cat test
Testy, isn't it.
Testo
It's Testy.
Testa
[pjb@thalassa tmp]$ sed -e /'/s/Test/Grump/ < test
Grumpy, isn't it.
Testo
It's Grumpy.
Testa
[pjb@thalassa tmp]$ sed -e "/'/s/Test/Grump/" < test
Grumpy, isn't it.
Testo
It's Grumpy.
Testa

--
__Pascal Bourguignon__ http://www.informatimago.com/
Kitty like plastic.
Confuses for litter box.
Don't leave tarp around.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com