kaka_2 has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks
i am writing a perl script to do small automation for my application. which require applcation's command to be run. first i use it in sub and it works well but next when i use inside the for loop it does not. can someone tell me what wrong i am doing.
-KAKA-sub ReadPolicies { # based on the below command it reads values in ar +ray my ($type) = @_; my @Policies = `/opt/OV/bin/opctemplate -l | grep -i $type | awk '{pri +nt \$2}'`; return (@Policies); } #MAIN My @FailoverPolicies = &ReadPolicies(DBSPI); For (my $i=0; $i < @FailoverPolicies; i++) { Print "/opt/OV/bin/opctemplate -e" . " " . $FailoverPolicies[$i], "\n" +; $output= `/opt/OV/bin/opctemplate –e $FailoverPolicies[$i]`; # here i +expect this command read each value from the array and take action, - +e to enable }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: execution of command inside for loop fails
by hdb (Monsignor) on Oct 01, 2013 at 13:32 UTC | |
by kaka_2 (Sexton) on Oct 04, 2013 at 10:41 UTC | |
by kaka_2 (Sexton) on Oct 04, 2013 at 11:03 UTC | |
Re: execution of command inside for loop fails
by jethro (Monsignor) on Oct 01, 2013 at 13:30 UTC | |
by kaka_2 (Sexton) on Oct 01, 2013 at 13:35 UTC | |
by moritz (Cardinal) on Oct 01, 2013 at 13:49 UTC |
Back to
Seekers of Perl Wisdom