progressfilt #!/bin/bash function progressfilt { local flag=false c count cr=$'\r' nl=$'\n' while IFS='' read -d '' -rn 1 c do if $flag; then printf '%s' "$c" else if [[ $c != $cr && $c != $nl ]]; then count=0 progressfilt How to get it? progressfilt else ((count++)) if ((count > 1)); then flag=true fi fi fi done } progressfilt How to get it? progressfilt function wget_nv { wget "$@" --progress=bar:force 2>&1 | progressfilt } 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 progressfilt