a sed equivelent
From: Jerry M. Howell II (jmhowell_at_jmhowell.com)
Date: 07/26/04
- Next message: Ian Marlier: "A RegEx question"
- Previous message: Jorge Almeida: "WTH is Perlmonth?"
- Next in thread: Bob Showalter: "RE: a sed equivelent"
- Maybe reply: Bob Showalter: "RE: a sed equivelent"
- Reply: Ramprasad A Padmanabhan: "Re: a sed equivelent"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: Perl beginners <beginners@perl.org> Date: Mon, 26 Jul 2004 07:51:06 -0400
hello all,
I'm just beginning to work with sed in shell scripts I was wondering
if anyone has a simmilar script in perl they can send my way or what the
perl equivelent of the sed /s would be. Here is the coresponding shell
script if it'll help you understand what I'm trying to acomplish.
#!/bin/sh
# Need some information from you
echo "what word or string are we looking for?"
read old
echo ""
echo "what do you wish to replace it with"
read new
for script in *
do
sed 's/'$old'/'$new'/g' <$script> outfile
mv outfile $script
done
sometimes this script works and sometimes it just clears the file out
leaving it empty. I need a viable alternative but don't even know where
to start. Thanks for any help you can give me.
-- Jerry M. Howell II email admin: usalug.org sys admin: hostbyk
- Next message: Ian Marlier: "A RegEx question"
- Previous message: Jorge Almeida: "WTH is Perlmonth?"
- Next in thread: Bob Showalter: "RE: a sed equivelent"
- Maybe reply: Bob Showalter: "RE: a sed equivelent"
- Reply: Ramprasad A Padmanabhan: "Re: a sed equivelent"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|