Created
March 16, 2016 05:09
-
-
Save bfatemi/4428dfb4e9e389a8fc10 to your computer and use it in GitHub Desktop.
Snippet to do something while a particular process is active
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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