[SunHELP] script request!

Edward Chase echase at studentweb.providence.edu
Mon Sep 23 15:30:35 CDT 2002


That would be it...

Thanks.

Still a bit weak on that stuff... The \* was key to me...




At 03:17 PM 9/20/2002 -0600, Donaldson, Mark wrote:

>It's all about regular expression matching.
>
>If you really mean "**" followed by four digits then:
>
>sed 's/\*\*[0-9][0-9][0-9][0-9]//g'
>
>-M
>
>-----Original Message-----
>From: Edward Chase 
>[<mailto:echase at studentweb.providence.edu>mailto:echase at studentweb.providence.edu] 
>
>Sent: Friday, September 20, 2002 8:48 AM
>To: Sun solaris help list
>Subject: RE: [SunHELP] script request!
>
>Cool... I have a similar need and was going to write a perl script to do
>it... but this may be easier...
>
>I have a file that I need to remove some stuff from...
>
>I need to replace each instance of **1234 with nothing.  The 1234 could be
>any number.
>
>Not all lines have this in it...
>
>
>At 04:11 PM 9/20/2002 +0200, Simon Jespersen wrote:
> >Hi list i got this example and i works really fine, thanks for input
> >
> >#!/usr/bin/ksh
> >for i in *.pl
> >do
> >sed 's/nana/mona/g' $i > $i.temp
> >mv $i.temp $i
> >done
> >
> >
> >
> >
> >Simon Jespersen
> >Project engineer
> >Pine Tree Systems A/S
> >Damhaven 5d
> >DK-7100 Vejle
> >Email: shj at pine.dk
> >Phone: +4575724477
> >
> >-----Original Message-----
> >From: sunhelp-admin at sunhelp.org 
> [<mailto:sunhelp-admin at sunhelp.org>mailto:sunhelp-admin at sunhelp.org]On
> >Behalf Of Simon Jespersen
> >Sent: 20. september 2002 15:12
> >To: Sun solaris help list
> >Subject: [SunHELP] script request!
> >
> >
> >Hi list!
> >
> >I need a script for replacing a string in a number of files in a directory
> >
> >i want to replace the string "nana" with the string "mona" in all *pl files
> >i wonder if anybody af a script or a easy way to do that.
> >
> >Kind regards
> >Simon Jespersen
> >Project engineer
> >Pine Tree Systems A/S
> >Damhaven 5d
> >DK-7100 Vejle
> >Email: shj at pine.dk
> >Phone: +4575724477
> >_______________________________________________
> >SunHELP maillist  -  SunHELP at sunhelp.org
> ><http://www.sunhelp.org/mailman/listinfo/sunhelp>http://www.sunhelp.org/m 
> ailman/listinfo/sunhelp
> >_______________________________________________
> >SunHELP maillist  -  SunHELP at sunhelp.org
> ><http://www.sunhelp.org/mailman/listinfo/sunhelp>http://www.sunhelp.org/m 
> ailman/listinfo/sunhelp
>_______________________________________________
>SunHELP maillist  -  SunHELP at sunhelp.org
><http://www.sunhelp.org/mailman/listinfo/sunhelp>http://www.sunhelp.org/mailman/listinfo/sunhelp 



More information about the SunHELP mailing list