Sponsored Content
Top Forums Shell Programming and Scripting Bash Scripting: Adding runtime in a progress bar Post 303013600 by Don Cragun on Saturday 24th of February 2018 05:09:28 AM
Old 02-24-2018
The current execution time could be formatted in grossly different ways that would require different format specifiers in a printf format string.

What is the format of the contents of the variable named runtm?

Show us some example values that might be assigned to runtm and show us the exact output you hope to produce when the variable j has the value 20, the variable totfcn has the value 50, and the variable runtm has the various example values you have provided.

Also show us how you have tried to modify the final printf statement in your code (and the output you got with the code you tried).
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

progress bar

i am trying to write a script where in it will connect to remote servers and execute remote scripts to fetch some data and ftp it back to a main server. i would like to add a script where it will show some sort of status bar until such time that the expected files have been recieved. something... (3 Replies)
Discussion started by: inquirer
3 Replies

2. UNIX for Advanced & Expert Users

progress bar

Hi all, I want to print # like that in a progress bar.. For e.g We can notice that during installation ... but,how to do that? Thnx, sakthi. (4 Replies)
Discussion started by: sakthi.abdullah
4 Replies

3. UNIX for Advanced & Expert Users

how to have a cp progress bar?

Hi all, This is a reformed post to my earlier ones!!!!!! I would like to know how to include a progress bar while using the cp... I am copying a few huge files from cdrom but am unable to figure out ,how to give a progress bar!!!!! I checked out other sites as well,but the issue here is... (1 Reply)
Discussion started by: wrapster
1 Replies

4. Shell Programming and Scripting

Progress bar

Hi friends, how can I show a progress bar for any running process in the shell script. For example when I am copying or compressing a file. Thanks. (1 Reply)
Discussion started by: dwiravi
1 Replies

5. Shell Programming and Scripting

progress bar

hi all, in shell script (ksh), how do i write a progress bar ?? i have a script which searches files and while its searching i am currently printing out "." and if it finds what its searching for the script prints out the name of the file e.g .................. firstFile.txt... (2 Replies)
Discussion started by: cesarNZ
2 Replies

6. Programming

A progress bar in C

Hello, it's me again...:eek: I need to create a progress bar in C, but i have no idea on how to do it. i want it to output something like this: Progress: 58% But i can't get it to work. Could you please post an example progress bar written in ANSI C? Thanks (4 Replies)
Discussion started by: Zykl0n-B
4 Replies

7. Shell Programming and Scripting

Progress bar for cp

I'm trying to use this code to get a progress bar for cp: "Can you get cp to give a progress bar like wget?" But I'm getting these errors: stat: illegal option -- c usage: stat awk: division by zero input record number 1, file source line number 4 I'm using Mac OS X 10.6... (1 Reply)
Discussion started by: pcwiz
1 Replies

8. Shell Programming and Scripting

Perl Progress BAR

Looking for a solution to why my progress bar not working My code print "STARTED:\n "; my $pdf = CAM::PDF->new('XYZ.pdf') or die $CAM::PDF::errstr; print STDOUT "Processing File: "; open (FILE, ">bill_data.txt") || die "Unable to save Bill_data.txt file"; for my $pagenum (1 ..... (4 Replies)
Discussion started by: chakrapani
4 Replies

9. Shell Programming and Scripting

Progress bar

Hi Experts; Im in the process of writing a shell script for enabling an IT operations to run archiving.We use netbackup. The script is complete, though there is one bit that i need help on. Im trying to have a progess bar for the procedure.I have gone through the man page of the command in... (5 Replies)
Discussion started by: maverick_here
5 Replies
DEBCONF-APT-PROGRESS(1) 					      Debconf						   DEBCONF-APT-PROGRESS(1)

NAME
debconf-apt-progress - install packages using debconf to display a progress bar SYNOPSIS
debconf-apt-progress [--] command [args ...] debconf-apt-progress --config debconf-apt-progress --start debconf-apt-progress --from waypoint --to waypoint [--] command [args ...] debconf-apt-progress --stop DESCRIPTION
debconf-apt-progress installs packages using debconf to display a progress bar. The given command should be any command-line apt frontend; specifically, it must send progress information to the file descriptor selected by the "APT::Status-Fd" configuration option, and must keep the file descriptors nominated by the "APT::Keep-Fds" configuration option open when invoking debconf (directly or indirectly), as those file descriptors will be used for the debconf passthrough protocol. The arguments to the command you supply should generally include -y (for apt-get or aptitude) or similar to avoid the apt frontend prompting for input. debconf-apt-progress cannot do this itself because the appropriate argument may differ between apt frontends. The --start, --stop, --from, and --to options may be used to create a progress bar with multiple segments for different stages of installation, provided that the caller is a debconf confmodule. The caller may also interact with the progress bar itself using the debconf protocol if it so desires. debconf locks its config database when it starts up, which makes it unfortunately inconvenient to have one instance of debconf displaying the progress bar and another passing through questions from packages being installed. If you're using a multiple-segment progress bar, you'll need to eval the output of the --config option before starting the debconf frontend to work around this. See "EXAMPLES" in the EXAMPLES section below. OPTIONS
--config Print environment variables necessary to start up a progress bar frontend. --start Start up a progress bar, running from 0 to 100 by default. Use --from and --to to use other endpoints. --from waypoint If used with --start, make the progress bar begin at waypoint rather than 0. Otherwise, install packages with their progress bar beginning at this "waypoint". Must be used with --to. --to waypoint If used with --start, make the progress bar end at waypoint rather than 100. Otherwise, install packages with their progress bar ending at this "waypoint". Must be used with --from. --stop Stop a running progress bar. --no-progress Avoid starting, stopping, or stepping the progress bar. Progress messages from apt, media change events, and debconf questions will still be passed through to debconf. --dlwaypoint percentage Specify what percent of the progress bar to use for downloading packages. The remainder will be used for installing packages. The default is to use 15% for downloading and the remaining 85% for installing. --logfile file Send the normal output from apt to the given file. --logstderr Send the normal output from apt to stderr. If you supply neither --logfile nor --logstderr, the normal output from apt will be discarded. -- Terminate options. Since you will normally need to give at least the -y argument to the command being run, you will usually need to use -- to prevent that being interpreted as an option to debconf-apt-progress itself. EXAMPLES
Install the GNOME desktop and an X window system development environment within a progress bar: debconf-apt-progress -- aptitude -y install gnome x-window-system-dev Install the GNOME, KDE, and XFCE desktops within a single progress bar, allocating 45% of the progress bar for each of GNOME and KDE and the remaining 10% for XFCE: #! /bin/sh set -e case $1 in '') eval "$(debconf-apt-progress --config)" "$0" debconf ;; debconf) . /usr/share/debconf/confmodule debconf-apt-progress --start debconf-apt-progress --from 0 --to 45 -- apt-get -y install gnome debconf-apt-progress --from 45 --to 90 -- apt-get -y install kde debconf-apt-progress --from 90 --to 100 -- apt-get -y install xfce4 debconf-apt-progress --stop ;; esac RETURN CODE
The exit code of the specified command is returned, unless the user hit the cancel button on the progress bar. If the cancel button was hit, a value of 30 is returned. To avoid ambiguity, if the command returned 30, a value of 3 will be returned. AUTHORS
Colin Watson <cjwatson@debian.org> Joey Hess <joeyh@debian.org> 2011-06-22 DEBCONF-APT-PROGRESS(1)
All times are GMT -4. The time now is 11:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy