I am trying to run a script on a remote machine via ssh. For this I want to change the directory and run the script from there. I found that the standard method on how to do this is:
ssh -Y -t user@server 'cd dir; exec bash'
However, the problem is that prior to running my script I need to setup some further scipts which I do in my ~./bashrc. My problem is that the way the command is written the change of directory happens before the ~./bashrc is even executed, i.e. messing up the code I need to set up before. Note: changing the command to
ssh -Y -t user@server 'exec bash; cd dir'
executes the bash normally, but doesn't change the directory afterwards. Thanks in advance.