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 }
In reply to execution of command inside for loop fails by kaka_2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |