I have some file tools on a mint machine that I would rather not install on my mac laptop. Mainly because of the vastness of apt-get and the low risk of installation failure. Anyway, every so often I have a file that I want to process in place using some remote tool. Both machines can ssh right in to each other so I was figuring there must be some script or tool out there that would allow me to type out something like remote [file] [tool & args] to send my file to the other machine, get it processed, then get it back.
|
|
|||
|
|
|
If the tool is a simple filter then you can just use it normally, but over ssh.
If it expects a filename but doesn't need to seek around in it or the output file then you can (ab)use bash for this.
Otherwise you will have to transfer the file to or from the other system. |
|||
|
|
|
The UNIX concept is do one thing and do it quietly. You can then build your own tools based on those simple processes. You just need to write a script which scp's the file to your machine, runs the ssh command to modify it and then pulls it back. Three lines, here's a very simple template,
Add parameters and put some error checking in and you're good to go. Or, as the other answer shows, you can route stdin/stdout to the other machine so for filters, it's even simpler. |
|||
|
|
|
Well, you could set up X11 forwarding through ssh from the machine the file-to-process is located in. This page is a good tutorial on how to do this. It basically lets you run the program from the remote server on your computer (using your computer's resources). |
|||
|
|
You can also try mounting the other system as a directory. Then you can access it normally as if it was on your mint machine. sshfs is one way to do this.
|
||||
|
|