i am trying to execute the following script to a remote machine via ssh :
mysql -u ocuser opencart < cmd.txt
i thought each command will simply wait until the command before it is complete but what ends up happening, the 2nd command "cd" executes trying to change to the folder before git clone finishes resulting in a failure..
if i put sleep for 60 sec "sleep 60" it endup adding carriage return to it and get passed as "sleep 60\r" which turns it into an invalid syntax
is that the expected behaviour ? how can i fix that ? any help is much appriciated