Launch only the command if the previous one worked inside SSH, SHELL
- by Namari
I've got a SHELL script which is using a pipe to separate my 2 commands:
ssh -oBatchMode=yes user@hostname "mysql -u yop -pyop -c yop | echo test"
The problem is even if my connection to mysql doesn't work, it send the echo test.
I would like to forbid my script to send any command if the previous command doesn't work.
I search with a if condition but it seems it not possible with it :(
Does anyone have an idea ?
Thanks,
Namari