Advertisement
Guest User

wget_nv

a guest
Feb 1st, 2019
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.71 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. function progressfilt {
  4.     local flag=false c count cr=$'\r' nl=$'\n'
  5.     while IFS='' read -d '' -rn 1 c
  6.     do
  7.         if $flag; then
  8.             printf '%s' "$c"
  9.         else
  10.             if [[ $c != $cr && $c != $nl ]]; then
  11.                 count=0
  12.             else
  13.                 ((count++))
  14.                 if ((count > 1)); then
  15.                     flag=true
  16.                 fi
  17.             fi
  18.         fi
  19.     done
  20. }
  21.  
  22. function wget_nv {
  23.     wget "$@" --progress=bar:force 2>&1 | progressfilt
  24. }
  25.  
  26. wget_nv --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/11.0.2+9/f51449fcd52f4d52b93a989c5c56ed3c/jdk-11.0.2_linux-x64_bin.tar.gz
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement