Reputation: 1
I want to ask about how to get notified if a program starts running in a shell script without checking it in a loop with 'pidof' for example, which consume CPU resources.
Upvotes: 0
Views: 509
Reputation: 21
You can use the inotifywait
command
inotifywait -e open /usr/bin/ls
change ls
for your desired program.
See inotify-tools packages.
Upvotes: 1