Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save padovah4ck/f8d8b10a4a2b76aec566f47cd735ef76 to your computer and use it in GitHub Desktop.
Save padovah4ck/f8d8b10a4a2b76aec566f47cd735ef76 to your computer and use it in GitHub Desktop.
ippsec process monitor script
#!/bin/bash
# Loop by line
IFS=$'\n'
old_process=$(ps aux --forest | grep -v "ps aux --forest" | grep -v "sleep 1" | grep -v $0)
while true; do
new_process=$(ps aux --forest | grep -v "ps aux --forest" | grep -v "sleep 1" | grep -v $0)
diff <(echo "$old_process") <(echo "$new_process") | grep [\<\>]
sleep 1
old_process=$new_process
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment