I want a shell script that connects to a server via ssh, starts watching a log, and then touches a file. It's important that I do them in that order, because I want to see in the log the effects of the second command. How do I write this? If I try something like:
ssh myserver tail -f /some/path/logfile &
ssh myserver touch /some/path/another-file
fg # hoping to see the output of first command
I get error about "no job control in this shell".