So this is the gist: I have a script that execute various commands.
One of these commands, returns some logging, regarding the operation performed. I would like to intercept this logging and stop the script, if there is an error. Since the following operations in the script, are tied to the success of this operation, it makes no sense to run the whole script when you get an error at this phase.
This command is run on a remote computer via ssh; the idea would be to stop the script, as soon as the ssh command quit and the control goes back to the script
Is there a simple way to check the output of a command, which is running in a shell script? I could redirect the output to a file, and parse it, but this seems to add a lot of work extra on the script; while I need to trigger the exit only if there were errors in the ssh command.
What would you suggest to accomplish this task?