Okay so I was just wondering if there is a way to have a progress bar on the top as the script is running to tell the user that x% of the process has been completed. Also is there a command that is built into the OS that would let me use a progress bar or would i have to design that as well in code?
Include in your script a percentage tracker, but will consume more resources...
For example if you are copying a bunch of files:
` foreach $y (@files) {
$countline++;
$total = 1000;
$lastcount = $currentcount
$currentcount = $countline / $total
if ( $lastcount > $currentcount ) {
$progress_display == 1
$currentcount
if ($progress_display == 1) {
print ".";
}
} print "\n"; `
There is zenity, a GTK application with GUI elements for scripts. It has a progress bar and much more.
The package dialog provides several UI elements for shell scripting. One of them is a gauge, a progress bar. Debian maintains a simplified version of dialog called whiptail.
There is also an X version of dialog: Xdialog, but I have never seen it myself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With