Skip to content

Instantly share code, notes, and snippets.

@bfatemi
Created March 16, 2016 05:09
Show Gist options
  • Save bfatemi/4428dfb4e9e389a8fc10 to your computer and use it in GitHub Desktop.
Save bfatemi/4428dfb4e9e389a8fc10 to your computer and use it in GitHub Desktop.
Snippet to do something while a particular process is active
apt-get update |pv -tN "Updating" > /dev/null & pid=$!
trap "kill $pid 2> /dev/null" EXIT
while kill -0 $pid 2> /dev/null; do
tput cup 10 10
done
trap - EXIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment