I have a remote machine with a Linux binary that accepts a number of arguments and a text file. The output of a program is written to stdout that I always write to a text file. I found myself copying a data file to the remote machine, executing the command on that file and copying the resulting file back. This is time consuming and error-prone.
Is it possible with SSH and the standard Linux tools to run a remote binary via SSH on a local file without copying it first to the remote machine?
Ideally, I would like to have a bash script on my local machine. I specify the data file as an argument and it performs all the SSH connection, data sending etc and outputs the result on stdout locally.
My local machine is Mac OS X and the remote is Linux. No, I can't get Linux binary to work on Mac OS X.
Update: The tool on the remote machine can read from stdin.