Computing.Net > Forums > Linux > Perl script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Perl script

Reply to Message Icon

Name: unc-newbie
Date: August 18, 2008 at 11:56:14 Pacific
OS: linux
CPU/Ram: dual 3gig xeon, 4gb ram
Product: centos
Comment:

I would like to create a script in perl that can run a cmd off a text file line by line. Here is the cmd that i need run:
./removespikes.pl (rrd file location)

The file that contains the rrd file location on a line by line basis.
/opt/rrdfiles/home/if_load.Fa0_1.rrd
/opt/rrdfiles/home/if_load.Fa0_10.rrd
/opt/rrdfiles/home/if_load.Fa0_11.rrd
/opt/rrdfiles/home/if_load.Fa0_12.rrd
/opt/rrdfiles/home/if_load.Fa0_13.rrd
/opt/rrdfiles/home/if_load.Fa0_14.rrd
/opt/rrdfiles/work/if_load.Fa0_15.rrd
/opt/rrdfiles/work/if_load.Fa0_16.rrd
/opt/rrdfiles/work/if_load.Fa0_17.rrd
/opt/rrdfiles/work/if_load.Fa0_18.rrd
/opt/rrdfiles/work/if_load.Fa0_19.rrd
/opt/rrdfiles/work/if_load.Fa0_2.rrd
/opt/rrdfiles/work/if_load.Fa0_20.rrd
/opt/rrdfiles/school/if_load.Fa0_21.rrd
/opt/rrdfiles/school/if_load.Fa0_22.rrd
/opt/rrdfiles/school/if_load.Fa0_1.rrd
/opt/rrdfiles/school/if_load.Fa0_10.rrd
/opt/rrdfiles/school/if_load.Fa0_11.rrd
/opt/rrdfiles/school/if_load.Fa0_12.rrd

So basically I am looking for a perl script that can run my removespikes.pl on a text file per line. And probably have it sleep for 5-10ms between each line.



Sponsored Link
Ads by Google

Response Number 1
Name: FishMonger
Date: August 19, 2008 at 14:15:54 Pacific
Reply:

That's a very inefficient approach.

Why not have your removespikes.pl script read the text file and process each line?


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Perl script

perl scripts for filtering mail www.computing.net/answers/linux/perl-scripts-for-filtering-mail/13380.html

Perl script is not executing www.computing.net/answers/linux/perl-script-is-not-executing-/20036.html

Can I use awk in a perl script? www.computing.net/answers/linux/can-i-use-awk-in-a-perl-script/26934.html