Hi,
I'm trying to use the output of a grep command in a shell script.
If I do-
$cmd = "grep 'abc' ./*";
$status = system $cmd;
Then $status always turns out to be 0, even if I use invalid arguments with grep.
If the result of grep is not empty, I want to perform some action and if it is empty, I want to do something else.
How can I get the output of grep into a string variable in the Perl script?
Any help will be highly appreciated.
Thanks.

Neelay.

Reply via email to