Re: Net::Telnet -- Checking File Exists -SOLUTION

2003-03-24 Thread Jeff Westman
Perseverance pays off. Solution to checking if a file exists is to store result in a variable before it gets converted: $result = sprintf("%s", $t->cmd("test -f $testFile && print 1 || print 0")); Note: None of the following worked: $result = ! $t->cmd( "test -f $testFile ; echo $?" ); $result

Re: Net::Telnet -- Checking File Exists

2003-03-24 Thread Jeff Westman
--- Jeff Westman <[EMAIL PROTECTED]> wrote: > > my $result = ! $t->cmd( "test -f $testFile ; echo $?" ); > > Doesnt work. (makes no difference) In my question below, I should state that it always returns '1' irregardless if the file exists or not > --- "John W. Krahn" <[EMAIL PROTECTED]>

Re: Net::Telnet -- Checking File Exists

2003-03-24 Thread Jeff Westman
> my $result = ! $t->cmd( "test -f $testFile ; echo $?" ); Doesnt work. (makes no difference) --- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > Jeff Westman wrote: > > > > How do you check if a file exists on a remote server using Net::Telnet ? > > > > I have tried: > > > > $testFile = "/tmp

Re: Net::Telnet -- Checking File Exists

2003-03-24 Thread John W. Krahn
Jeff Westman wrote: > > How do you check if a file exists on a remote server using Net::Telnet ? > > I have tried: > > $testFile = "/tmp/noFileExistsHere"; > > $result = $t->cmd("test -f $testFile ; print $? "); > $result = $t->cmd("test -f $testFile && print 1 || print 0"); > $result = $t->cmd

Net::Telnet -- Checking File Exists

2003-03-24 Thread Jeff Westman
How do you check if a file exists on a remote server using Net::Telnet ? I have tried: $testFile = "/tmp/noFileExistsHere"; $result = $t->cmd("test -f $testFile ; print $? "); $result = $t->cmd("test -f $testFile && print 1 || print 0"); $result = $t->cmd("if [ -f $testFile ] ;then print 1; els