I did this:
ssh -f user@host "screen -dm -S screenName"
Now I want to add a bash script command to this line so that the command is executed then the screen detaches.
edit:
so I want to do so
ssh -f user@host "screen -dm -S screenName bash bashing.sh"
bashing.sh:
#!/bin/bash
echo "testing it";
but actually nothing happens when I run the command over ssh.
Even when I just from the server run this command only screen -dm -S screenName bash bashing.sh
.
edit 1:
I tried everything so far in the answers and comments and even in the suggested question as duplicate but nothing works for me, so any help would be still very appreciated.
Sincerely
so I did it like this ssh -f user@host "screen -dm -S screenName sh bashScript.sh" ====== and like this ssh -f user@host "screen -dm -S screenName ./bashScript.sh" ========== and like this ssh -f user@host "screen -dm -S screenName bash bashScript.sh" ======= and none of this run the script
– Omar K. Aly Mar 28 '18 at 11:54ssh -f user@host "screen -dm -S screenName bash /path/to/bashing.sh"
– Kiwy Mar 28 '18 at 14:01