I wrote a shell script "A" which will invoke any shell script "B".
I have both script "A" and "B" on /tmp/test directory of the machine M2
On machine M1,
I do a
ssh M2 "cd /tmp; ls -l"
I see A and B from the list output
However, if I
ssh M2 "cd /tmp; A"
I got a message
/tmp/A:B: not found
It seem that I was successfully cd to /tmp on M2 and executing A on /tmp but it doesn't find B.
Why is that? What should I do to execute A on the directory that I cd to on the remote host?