CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
System Call for another Perl Program

 



bforaker
New User

Apr 16, 2010, 1:17 PM

Post #1 of 5 (1380 views)
System Call for another Perl Program Can't Post

Hi,

I am wondering if someone can help.. I am doing a while loop to read from a file.. I would like to have the variable go into the other script I am calling the other script requires server username and password... Please help... Thank you so essentially i would like where $ is to represent where the loop is reading from...



open (filers, "filerlist.txt");

while ($ntap = <filers>) {
print $ntap;

system("ntapchk.pl $ <userid> <password>");

}

close(filers);


(This post was edited by bforaker on Apr 16, 2010, 4:10 PM)


FishMonger
Veteran / Moderator

Apr 16, 2010, 3:58 PM

Post #2 of 5 (1371 views)
Re: [bforaker] System Call for another Perl Program [In reply to] Can't Post


Code
system("ntapchk.pl $ntap bforaker-adm redrun54");


If that doesn't do what you want, then you'll need to provide more details of what you need.


bforaker
New User

Apr 16, 2010, 4:10 PM

Post #3 of 5 (1368 views)
Re: [FishMonger] System Call for another Perl Program [In reply to] Can't Post

  
Thanks for the reply.. .yeah I put the $ntap in there and it did not work.. here is my output

and when I hard code the filer name there.. it works but of course it does not put the output of each filer in the txt file.





output when I run the loop

Usage: ntapchk.pl <filername> <userid> <password>
Whereas filername is the DNS name of the filer.
Example: dow\nzz3686 mypasswordusib-pfsx-cf02b

Usage: ntapchk.pl <filername> <userid> <password>
Whereas filername is the DNS name of the filer.
Example: dow\nzz3686 mypasswordusib-pfsx-cf01a

Usage: ntapchk.pl <filername> <userid> <password>
Whereas filername is the DNS name of the filer.
Example: \nzz3686 mypasswordusib-pfsx-cf02b

Usage: ntapchk.pl <filername> <userid> <password>
Whereas filername is the DNS name of the filer.
Example: dow\nzz3686 mypassword
C:\Documents and Settings\bforaker-adm\Desktop\Scripts\Dev>



when I hard code the filer informattion

#open PERLFILE, "ntapchk.pl";
open (filers, "filerlist.txt");

while ($ntap = <filers>) {
print $ntap;

system("ntapchk.pl usib-pfsx-cf02a <userid> <password>");

}

close(filers);

it loops these filers below but since I hardcoded the information for cf02a I only output that information...

usib-pfsx-cf02a
usib-pfsx-cf02b
usib-pfsx-cf01a
usib-pfsx-cf02b


(This post was edited by bforaker on Apr 16, 2010, 4:11 PM)


FishMonger
Veteran / Moderator

Apr 16, 2010, 4:18 PM

Post #4 of 5 (1363 views)
Re: [bforaker] System Call for another Perl Program [In reply to] Can't Post

You need to remove the line terminator.


Code
while ($ntap = <filers>) { 

print $ntap;
chomp $ntap;
system("ntapchk.pl $ntap <userid> <password>");

}

close(filers);



bforaker
New User

Apr 19, 2010, 12:02 PM

Post #5 of 5 (1287 views)
Re: [FishMonger] System Call for another Perl Program [In reply to] Can't Post

Thank you sir... I really appreciate it... I may hit you back up on a few other things.. I may need to get your paypal account if you would like some extra $$$'s Again thanks..

Bryan

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives