I want to do something like
#!/bin/bash
ssh name@computer 'cd /my/dir'
and then continue working in this directory.
Right now if I execute a script "myscript" containing the above, it just drops me back into the bash shell where I started, whereas I want to be able to do work and stuff on this other computer.
I know this command is being execututed because if I change the script to
#!/bin/bash
ssh name@computer 'echo blah > blah.txt'
blah.txt does get created on the remote computer.
So the main question is, how do I keep that remote session open rather than reverting back to my original session.
I tried
./myscript &
but that didn't work.
Obviously this is a pretty simple problem, but I figure if I can get this working I learn something that can be applied to solving more powerful scenarios.
Thanks for your help in advance!