I have a bash script that ends as follows:
trap "exit" INT
for ((i=0; i < $srccount; i++)); do
echo -e "\"${src[$i]}\" will be synchronized to \"${dest[$i]}\""
echo -e $'Press any key to continue or Ctrl+C to exit...\n'
read -rs -n1
#show_progress_bar()
rsync ${opt1} ${opt2} ${opt3} ${src[$i]} ${dest[$i]}
done
I need a command or a function such as show_progress_bar()
that put .
(a dot) in the stdout every one second while rsync
command is running (or a rotating /
that rotates as / - \ |
sequence while rsync
is running).
Is it possible? Do I need to wrote such function myself, or there is available scripts for this purpose?