[Techtalk] filtering command line

Michelle Konzack linux4michelle at freenet.de
Wed Jun 13 17:01:23 UTC 2007


Am 2007-06-11 15:31:05, schrieb Conor Daly:
> On Mon, Jun 11, 2007 at 09:42:03PM +1000 or so it is rumoured hereabouts, 
> Miriam English thought:
> > 
> > After doing a fair bit of reading I have a feeling I might need to use 
> > sed with something like
> > s/\//\/g
> 
> The fun thing with sed is when you start trying to escape characters.  It
> can get very messy very fast.   However, sed allows you to use any
> delimiter in your expression.  So, in the case where you want to match a
> '/', you could do something like:
> 
> s@/@\@g
> 
> where '@' is now the pattern delimiter.  There is probably a way to tell
> sed to use a different escape character so that you could do:
> 
> s@/@\@g
> 
> but I have no clue how to do that...

Try:
    's|\\|/|g'

and it just works... Had to fight several times with it.


Greetings
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSN LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)


More information about the Techtalk mailing list