Skip to content

Instantly share code, notes, and snippets.

@rubeniskov
Last active September 29, 2022 00:39
Show Gist options
  • Save rubeniskov/41750b229f1275b1da212d0c1018d8f9 to your computer and use it in GitHub Desktop.
Save rubeniskov/41750b229f1275b1da212d0c1018d8f9 to your computer and use it in GitHub Desktop.
Custom curl progress
curl https://goo.gl/g8PnUL -L -o bbb_sunflower.mp4 --progress-bar 2>&1 |
while IFS= read -d $'\r' -r p; do
p=${p:(-6)}
p=${p%'%'*}
p=${p/,/}
p=$(expr $p / 10 2>/dev/null);
echo -ne "[ $p% ] [ $(eval 'printf =%.0s {1..'${p}'}')> ]\r"
done
# TODO
curl https://goo.gl/g8PnUL -L -o bbb_sunflower.mp4 --progress-bar 2>&1|awk -v OFS="\r" -v RS="\r|\n" '{
printf("%s\r", substr( $0, length($0)-5, 5 ))
#str_splitter=sprintf("%"column_sizes[i]"s", "");
#gsub(/ /, "-", str_splitter);
#printf("%s",("|"str_splitter));
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment