Unix and I have never been friends, so I can't help you with the system
call, but have you tried doing a "print $pcommand"?

-----Original Message-----
From: Randy Brown
To: [EMAIL PROTECTED]
Sent: 3/29/02 11:41 PM
Subject: checking if file exists on remote machine...

I'm trying to check if a file exists on a remote machine using perl.  I
am unable to make this work.  Anyone have any suggestions?

Thanks!

Randy


       #       if source files not there, error
        $length=@source_file;
        $counter=0;
        print "\n\n";
        while ($counter < $length)
        {

        #print "\nCHECKING REMSH\n";



                $pcommand="remsh $source_machine -l username -n ls
$source_file[$counter] 2>/dev/null;";

                if (  `$pcommand` !~ "$source_file[$counter]" )
                {print "\n >>> COULD NOT FIND SOURCE FILE>>>
$source_machine[$counter]:$source_file[$counter]\n\n\n";exit;}

                $counter++;
        } 

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


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

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

Reply via email to