in reply to Re^2: NET:SSH2 exec syntax usage
in thread NET:SSH2 exec syntax usage

Thank You SitrucHtims.

This Worked
ex. $chan->exec('zcat /db2home/idsldap/idsslapd-idsldap/logs/ibmslapd.log.' . $ibmslapd_fn . '-2350.gz | grep -i "entries have been successfully" ');

This Didn't
escaping the double quotes didn't work...
$chan->exec("zcat /db2home/idsldap/idsslapd-idsldap/logs/ibmslapd.log.$ibmslapd_fn-2350.gz | grep -i \"entries have been successfully\" ");

Thanks again for your assistance. My Issue is solved.

The $chan->blocking(0); statement didn't seem to matter.

Replies are listed 'Best First'.
Re^4: NET:SSH2 exec syntax usage
by SitrucHtims (Novice) on Apr 22, 2011 at 01:07 UTC

    The double quotes failed because I missed escaping the "|" character. It is another perl special character. Should work fine as below.

    $chan->exec("zcat /db2home/idsldap/idsslapd-idsldap/logs/ibmslapd.log.$ibmslapd_fn-2350.gz \| grep -i \"entries have been successfully\" ");