Last active
March 12, 2020 13:18
-
-
Save crater2150/a7f685ef22d09100e5f55a188c90ba86 to your computer and use it in GitHub Desktop.
zsh: run operations on files while showing progress
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
files=(*.foo) | |
for i in {1..$#files}; do | |
file=$files[$i] | |
pad=${#${#files}} | |
printf "\e[2K\e[G ‣ %${pad}d / %${pad}d: %s" $i $#files $file | |
{ | |
# do stuff with file here | |
} &>/dev/null | |
done | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment