Hi,
In a script I'd like to monitor the process list in a way that, in order to continue the execution of the script, a certain process has to be started.
I came up with something like:
while ! pgrep "process_to_match"
do
sleep 10
done;
# the rest of the script
The problem with that script is that if the "process_to_match" is started for less than 10ms the "rest of the script" won't be executed.
An even better solution for me would be to trigger the execution of a script on "process_to_match" launch.
Any ideas? Thanks.