Please suggest some solutions. Normally I ssh to an other computer and do some calculations there then I just sftp when I need to transfer data from that machine to my local host machine. This time around I want to send some input from my local machine to the remote machine, the remote machine will do its bit and then send me back its output. How can I automate this process so that it repeats as many times as I specify on my local machine? Is this quite complicated to do. Please let me know if I have not given enough detail.

This is the manual process.

```
ssh username@remote.machine !ssh to remote machine
program.o input.dat         !supply input to the program
sftp username@remote.machine !ftp to remote machine from another terminal
get output.dat              !output.dat was produced by program.o
!open an other terminal
another_prog.o output.dat   !run another program on my local machine
!Then repeat. Some times I may compile using a make file.

```

I want to automate this process. what are my options. The programs are written in any number of languages like C++/c, fortran. I am an o.k programmer but I have never had a situation where I had to do the above, so teach me :)

Both my local and remote machines are linux/ubuntu