http://qs1969.pair.com?node_id=616727

msk_0984 has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,

I am facing a problem in integrating Shell commands with a Perl Script...

I used Shell module in my program.

I am getting error at awk in following code:

#!/usr/bin/perl use Shell; $sh = Shell->new; print $sh->ls("-l ./logs/ |grep -v "^d" |grep -v file1 | awk 'NR>1 { p +rint \$9}'");
here $sh is Shell object...

When executed the same command at CLI it is giving correct result....

Here is the error which is being printed on execution of the program

String found where operator expected at grep_data.cgi line 12, near "d" |grep -v "" Bareword found where operator expected at grep_data.cgi line 12, near "" |grep -v "file1" (Missing operator before file1?) String found where operator expected at grep_data.cgi line 12, near "file1" | awk 'NR>1 { print \$9}'"" syntax error at grep_data.cgi line 12, near "d" |grep -v "" Execution of grep_data.cgi aborted due to compilation errors.

Work Hard Party Harderrr!!
Sushil Kumar