--- Saifuddin_Bohra/[EMAIL PROTECTED] wrote:
>
> Hi,
>       I am new to Perl. I have a follpwing shell script
> 
> if [ -n "`netstat -na|grep LISTEN |grep 1099`" ];
> then
>         exit 0
> else
>         exit 1
> fi
> 
> I need the perl script for the same job.
> and how to use this in another perl program
> Any pointer ??
> 
> saifuddin

This should work .....

#!/bin/perl
use warnings;
use strict; 

if ( length(qx(netstat -na|grep LISTEN |grep 1099)) > 0 ) {
    exit(0);
}
else {
    exit(1);
}

(There are ways to shorten this, but this is the basic code I think you are
looking for)


-Jeff


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to