Quote:
|
But now my problem is that i have a file opened in write mode at my machine in perl script and i want to write all the data that my commands are showing on remote machine.In any way can i do this?
|
This part is confusing. Unix OSes don't care if perl has something opened in write mode, they'll happily ignore it.
It sounds like 'mkfifo' might help you, if you're on Unix. A FIFO is a special file that processes can read from and write to. It does the same thing as | on the command line, but it can be more flexible. Sometimes it's very useful with complicated ssh commands.
If you're just tying to capture ssh's output, you can just pipe your whole ssh command to a process or redirect it to a file. (Except that ssh seems to add a newline or something to the end of your session, which can be an issue for binary transfers.)
Also Unix: If you're trying to monitor a file, do "man tail" and look at the -f option. You can open a session with ssh, run "tail -f whatever_file" and it will watch that (remote) file for you.