[SunHELP] script request!


Fri Sep 20 16:17:59 CDT 2002


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]
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]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
>_______________________________________________
>SunHELP maillist  -  SunHELP at sunhelp.org
>http://www.sunhelp.org/mailman/listinfo/sunhelp
_______________________________________________
SunHELP maillist  -  SunHELP at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sunhelp



More information about the SunHELP mailing list