in reply to Re^2: Effective way in perl
in thread Effective way in perl

The fact that your "log_std_depot" log file is showing two slashes in a row indicates that you are not setting $i. Apart from that, if you take the command line string from that log file ("/usr/sbin/swlist -l depot @ sidedepot.fc.com") and run it manually in a shell, what happens?

If you make changes in the command string in order to get it to work in the shell, just make sure you apply the same changes in the perl script.

Replies are listed 'Best First'.
Re^4: Effective way in perl
by RajNaidu (Novice) on Jul 17, 2009 at 05:52 UTC
    I replaced $i with 1111 and ran the perl script, still I am getting below lines in the output file. Its not actually getting executed. COMMAND: /usr/sbin/swlist -l depot @ sidedepot.fc.com ## FILTERS: 0909 / 1111 / AR However if I run the same command on command line, its working fine. I am using the below command in the command line. /usr/sbin/swlist -l depot @ sidedepot.fc.com | grep 0909 | grep 1111 | grep AR In the script, we are not using grep, could this be the reason next unless ( /$rel_string/ and /$i/ and /AR/ ) ?????
Re^4: Effective way in perl
by RajNaidu (Novice) on Jul 17, 2009 at 08:50 UTC
    Hi graff, The below code is not working. next unless ( /$rel_string/ and /$i/ and /AR/ ); If i give only next unless ( /$rel_string/ ), it works fine.