Hello,
I have a script that opens a file, performs some "sed"
operations, and then saves the edited file to a new
file name. Currently, I have to supply the names of
input and output files, within the script.
My question: I would like to be able to have the
automically open all the files in a given directory,
one at a time, perform the "sed" operations, and then
save them to the directory. How can I do this ?
Here is the script:
#!/usr/bin/perl -w
open (IN,"< orig_names.txt");
open (OUT,">mod_names.txt");
while (<IN>) {
chomp;
if ($_=~/^lname/i) {
s/holt/henning/;
s/shultz/stultz/;
}
}
close (IN);
close (OUT);
exit(0);
I would greatly appreciate your help in this regards.
Thanks
PN
__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]