if it's a directory you want to test add -d switch to the ls command.my $g_cmd="ssh Machinename ls <completefilepath>"; `$g_cmd`; if($?) { print "Error doesnot exist"; } else { $g_cmd="scp local_file remotehost:targetdirectory/remote_file"; `$g_cmd`; }
In reply to Re: File test on remote machine and mkpath
by narainhere
in thread File test on remote machine and mkpath
by gopichaithanya
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |