using the system command with "rcp and rsh"
Posted on 2006-05-26
I have a script which I am trying to call from a Browser. I want to use "rsh" and "rcp" using a system command to access data on another server. Below is my script. Both the rsh and rcp command work fine when run in the command line.
print "Content-type: text/html\n\n";
print "Hello World\n";
system(`rsh server.domain.com -l user 'ls -l' > test.txt`);
system(`rcp email@example.com:/path/to/file/file.name file.localcopy`);
The "Hello World" string gets printed to my Browser.
The test.txt file gets created locally but is EMPTY
The rcp command does not return anything.
If I run the rsh command on my CLI I get the test.txt file created with the directory contents from teh ls -l command
If I run the rcp command in the CLI I get the file transferred.
Simply when I trancfer the commands to teh script they stop working!!!!
Any thoughts, comments will be greatly appreciated.