sed help please
Hi,
I've come up with this sed command: sed s//media// filename One question, how can I include the / charactar in the search patton? This works fine except, I need to add a / in the search patton, any ideas how to do this so sed doesn't complain? Thanks very much, Daniel. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
sed help please
Hi Daniel,
On Tue, Jan 27, 2009 at 09:35:46PM +1100, Daniel Dalton wrote: > Hi, > > I've come up with this sed command: > sed s//media// filename > > One question, how can I include the / charactar in the search patton? > This works fine except, I need to add a / in the search patton, any > ideas how to do this so sed doesn't complain? Use a backslash bevor the slash/: "/" works fine Axel -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
sed help please
Axel Freyn (2009-01-27 12:11 +0100) wrote:
> On Tue, Jan 27, 2009 at 09:35:46PM +1100, Daniel Dalton wrote: >> sed s//media// filename >> >> One question, how can I include the / charactar in the search patton? >> This works fine except, I need to add a / in the search patton, any >> ideas how to do this so sed doesn't complain? > Use a backslash bevor the slash/: "/" works fine Yes, or use some other character to separate the parameters of "s" command. This example uses comma: sed -e 's,pattern,replacement,' Then "/" does not need backslash-escaping but "," does. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
sed help please
Hi Axel,
> Use a backslash bevor the slash/: "/" works fine Thanks, very much, that worked! Cheers, Daniel. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
| All times are GMT. The time now is 12:49 AM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.