Skip to content

Instantly share code, notes, and snippets.

@kkirsche
Created March 8, 2018 20:55
Show Gist options
  • Select an option

  • Save kkirsche/57926b7852bd83df63857994c20baca0 to your computer and use it in GitHub Desktop.

Select an option

Save kkirsche/57926b7852bd83df63857994c20baca0 to your computer and use it in GitHub Desktop.
Process monitoring
#!/bin/bash
# Loop by line
IFS=$'\n'
old_process=$(ps -eo command)
while true; do
new_process=$(ps -eo command)
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