Created
May 10, 2011 21:21
-
-
Save niteria/965404 to your computer and use it in GitHub Desktop.
make nice progress bar for batch script
This file contains 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
#!/bin/bash | |
echo 50 | |
for i in `seq 1 10`; do echo '1'; sleep 1; done |
This file contains 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
#!/bin/bash | |
pipename=`uuidgen` | |
mkfifo "$pipename" | |
trap "rm -f -- '$pipename'" EXIT | |
./cmd.sh > "$pipename" & | |
num=$(head -n 1 "$pipename") | |
cat "$pipename" | pv -s $num -p -l -e -t -b > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment