I am writing an update script like that:
update.sh
#!/bin/bash
sudo echo
printf "### PACMAN\n" # I am running Arch Linux
sudo pacman -Syu
printf "\n### YAY\n"
yay -Syua
printf "\n### CUSTOM\n"
custom_script.sh # code below
custom_script.sh
#!/bin/bash
# [...]
wget --quiet --show-progress <some link>
# [...]
The output looks something like this:
### PACMAN
<...>
:: Retrieving packages...
linux-lts-4.14.88-1-x86_64 60,8 MiB 725K/s 01:26 [########################################] 100%
<...>
### YAY
:: Searching AUR for updates...
there is nothing to do
### CUSTOM
:: Downloading custom updates...
somefile.txt 100%[================================================>] 20,92M 3,83MB/s in 5,6s
Is there a way to make the wget
command in custom_script.sh
format the progress bar the same way as pacman
? I'm open to use curl
or some other download tool as well.
Desired output:
### PACMAN
<...>
:: Retrieving packages...
linux-lts-4.14.88-1-x86_64 60,8 MiB 725K/s 01:26 [########################################] 100%
<...>
### YAY
:: Searching AUR for updates...
there is nothing to do
### CUSTOM
:: Downloading custom updates...
somefile.txt 20,9 MiB 3,8M/s 00:05 [########################################] 100%