On Sat, Jan 12, 2002 at 09:47:08PM +0530, Binand Raj S. wrote:
> On Saturday 12 January 2002 21:35 pm, Philip S Tellis wrote:
> > Sometime Today, Binand Raj S. assembled some asciibets to say:
> > > sed -e 's,\(/usr\)\(/bin\),\1/local\2,g'
> >
> > Why the grouping parens? avoid spelling mistakes? I prefer the |
> > character. It's more visible.
>
> Yes. And re your choice of |, each to his own, I use the comma. ;-)
>
> Really doesn't matter. pipes also sometimes come in the way, comma
> hasn't done that with me so far.
>
---end quoted text---
The main problem in this case is the way sed treats the "/"
char. This would need the \ character to precede. The foll-
owing script will will convert all /usr/bin to the desired
/usr/local/bin. Makes things more understandable ... easier
than going through semantics of long cryptic strings ...
-------------<snip>--------------------
#!/bin/sh
# Usage : scriptname input-script
OLD="bin"
NEW="local\/bin"
sed "s/$OLD/$NEW/g" < $1 > newfilename
------------</snip>--------------------
Bish
--
:
####[ Linux One Stanza Tip (LOST) ]###########################
Sub : Procmail recipe for OE Worms LOST #060
Several M$ worms like SirCam, CodeRed use a dummied multi part
OE boundary, starting with an underscore ( _Outlook_ ... ) . A
procmail recipe to segregate mail with such payload:
:0 D
* ^Content-Type:
* multipart.*"----[A-F0-9]+_Outlook_Express_message_boundary"
/home/{user}/mail/danger_here
####<[EMAIL PROTECTED]>###################################
:
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help