How to show wget progress bar only?

前端 未结 9 902
情歌与酒
情歌与酒 2021-01-30 06:19

For example:

wget http://somesite.com/TheFile.jpeg

downloading: TheFile.tar.gz ...
--09:30:42--  http://somesite.com/TheFile.jpeg
                   


        
9条回答
  •  情歌与酒
    2021-01-30 06:47

    This is another exemple, maybe will help you

    download() {
        local url=$1
        echo -n "    "
        wget --progress=dot $url 2>&1 | grep --line-buffered "%" | sed -u -e "s,\.,,g" | awk '{printf("\b\b\b\b%4s", $2)}'
        echo -ne "\b\b\b\b"
        echo " DONE"
    }
    

提交回复
热议问题