I've got a SHELL script which is using a pipe to separate my two 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 does the echo test.
I would like to forbid my script to perform any command if the previous command doesn't work.
I search for a solution using if but I couldn't come up with anything.
mysqlin another command ? – sputnick Oct 11 '12 at 22:56