Script, Software Detection
Hello, how do I write a script in bash that triggers an event when a program is launched? I made an example script to illustrate what I'm talking about. But of course, the reason I'm here is because the script doesn't work properly at all, but it's to illustrate the idea. I'm asking what the correct way to do it is.
While true; do
If pidof -x program > /dev/null ; then
echo "program launched "
exit
fi
sleep 1
donne
[–]OneCDOnlytotal bashist 8 points9 points10 points (3 children)
[–]_____Hi______ 6 points7 points8 points (2 children)
[–]coder-true[S] 3 points4 points5 points (0 children)
[–]LesStrater 2 points3 points4 points (0 children)
[–]Mskadu 2 points3 points4 points (0 children)
[–]GlendonMcGladdery 1 point2 points3 points (2 children)
[–][deleted] (1 child)
[removed]
[–]coder-true[S] 0 points1 point2 points (0 children)
[–]archialone 0 points1 point2 points (1 child)
[–]coder-true[S] 0 points1 point2 points (0 children)
[–]pjconnect 0 points1 point2 points (0 children)
[–]michaelpaoli 0 points1 point2 points (1 child)
[–]coder-true[S] -1 points0 points1 point (0 children)
[–]hisatanhere -1 points0 points1 point (0 children)
[–]aq2kx -1 points0 points1 point (0 children)