In Bash we can run programs like this
./mybin && echo "OK"
and this
./mybin || echo "fail"
But how do we attach success or fail commands to existing process?
Edit for explaination:
Now we are running ./mybin
.
When mybin
exits with or without error it will do nothing, but during mybin
is running,
how can I achieve the same effect like I started the process like ./mybin && echo ok || echo fail
?
In both shell script and python programming way would be awesome, thanks!