When scripting in bash or any other shell in *NIX, while running a command that will take more than a few seconds, a progress bar is needed.
For example, copying a b
for me easiest to use and best looking so far is command pv
or bar
like some guy already wrote
for example: need to make a backup of entire drive with dd
normally you use dd if="$input_drive_path" of="$output_file_path"
with pv
you can make it like this :
dd if="$input_drive_path" | pv | dd of="$output_file_path"
and the progress goes directly to STDOUT
as this:
7.46GB 0:33:40 [3.78MB/s] [ <=> ]
after it is done summary comes up
15654912+0 records in
15654912+0 records out
8015314944 bytes (8.0 GB) copied, 2020.49 s, 4.0 MB/s