FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 01-27-2009, 09:35 AM
Daniel Dalton
 
Default 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
 
Old 01-27-2009, 10:11 AM
Axel Freyn
 
Default 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
 
Old 01-27-2009, 10:20 AM
Teemu Likonen
 
Default 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
 
Old 01-27-2009, 11:11 AM
Daniel Dalton
 
Default 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
 

Thread Tools




All times are GMT. The time now is 05:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org