Skip to content

Instantly share code, notes, and snippets.

@jsvazic
Last active July 3, 2020 09:30
Show Gist options
  • Save jsvazic/8fe9dde369f6396f65a1aa795dd77744 to your computer and use it in GitHub Desktop.
Save jsvazic/8fe9dde369f6396f65a1aa795dd77744 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
@jsvazic
Copy link
Author

jsvazic commented Mar 18, 2018

Made some minor updates to give a bit more information in case you want to see the parent processes, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment