Let's say that I have this bash function
where I firstly connect to a Remote Desktop and then I want to use a second argument while I am connected to the command line of the Remote Desktop (that's why I've used the single quotation marks. However, I am not sure how to surround the $2
argument.
my_func () {
ssh blah blah blah $1 'cd $2'
}
I am not sure about the way I should specify the second argument. I've tried to run this function in the local machine as:
my_func a b
, where b is a directory in the Remote Desktop, but I don't seem to have the expected output.
cd
is just an example for simplicity, it's not the actual purpose)! – thanasissdr Oct 06 '17 at 11:47$2
contains'
. – Valentin B. Oct 06 '17 at 11:48