Skip to content

Instantly share code, notes, and snippets.

@mscalora
Created October 3, 2015 13:59
Show Gist options
  • Save mscalora/ef0b35897e1823550bf1 to your computer and use it in GitHub Desktop.
Save mscalora/ef0b35897e1823550bf1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
if [ "$1" == "" ] ; then
__keyword="python"
else
__keyword="$1"
fi
(
while :; do
__arg=$(pgrep -d',' -f $__keyword)
top -c -n 1 -p ${__arg}$(cat /proc/sys/kernel/pid_max)
sleep 1
done;
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment