Re: Find and replace script

2001-01-26 Thread Cameron Simpson
| I was wondering if someone might be able to help me out with a situation. I | need a script that will run every night that will process some logs. It | needs to find all instances of "+0100", and replace it with "-0500". I'm | not all that experienced with shell scripts, although I'm trying t

Re: Find and replace script

2001-01-26 Thread Statux
> for i in logs; do > > cat $i |sed 's/+0100/-0500/' > $i.tmp > mv -f $i.tmp $i > > done Right.. but again (as I stated) in case people ignore my posting, you need the g on the end of the s statement in case there's more than one thing to replace on a line :) If there isn't, it's not a problem

Re: Find and replace script

2001-01-26 Thread Statux
cat logfile.txt | sed 's/+0100/-0500/g' > anotherfile.txt The above command will parse logfile.txt, change things as you wish with the sed command (I believe this will work), and send the output to anotherfile.txt. The 's' at the beginning starts the s statement and the 'g' at the end tells sed n

Re: Find and replace script

2001-01-26 Thread Hal Burgiss
On Fri, Jan 26, 2001 at 07:49:02PM -0500, Mark Basil wrote: > I was wondering if someone might be able to help me out with a > situation. I need a script that will run every night that will > process some logs. It needs to find all instances of "+0100", and > replace it with "-0500". I'm not al