vramsteg(1)

πŸ“¦
version 1.1.1 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

✨ vramsteg(1) β€” the CLI progress bar that's literally the moment πŸ’…

okay bestie, welcome to the vramsteg manual page, it lives in the User Manuals section and it's about to change your shell scripts forever 🫢


🌸 NAME 🌸

vramsteg β€” CLI progress bar. that's it, that's the name, and honestly? iconic. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

so here's the vibe. to display/update a progress bar:

vramsteg --min <integer> --max <integer> --current <integer> [options]

to remove a progress bar:

vramsteg --remove

to capture the start time:

START=$(vramsteg --now)

to include elapsed time (which requires a start time):

vramsteg --start=$START --elapsed ...

to include estimated remaining time (which requires a start time):

vramsteg --start=$START --estimate ...

to use a specific bar width:

vramsteg --width 100 ...

to show the percentage completed:

vramsteg --percentage ...

to show a label at the beginning of the bar:

vramsteg --label This is a label ...

to use an alternate rendering style:

vramsteg --style <style-name> ...

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so vramsteg ('progress' in Swedish, almost πŸ₯Ί) is an open source, command line utility that gives your shell scripts a full-featured progress indicator. no cap. it can display elapsed time, remaining time estimate, percentage completed, and labels. and the bar can have user-specified colors AND be rendered in multiple styles. it's giving customizable. it's giving range. ✨

if you have a shell script, or in fact any command line program that needs a progress bar, vramsteg may be the right solution. suppose you have a program that is performing a lengthy operation β€” provided that it has an opportunity to execute vramsteg frequently, then integrating a progress bar is simple. lowkey the easiest glow-up your script will ever get πŸ’…

you may have seen progress bars used to good effect in the rsync or scp commands, among others. yeah, those bars? that energy. that's what we're serving here. πŸ”₯


🌈 EXAMPLES 🌈

here is a complete bash shell script illustrating how vramsteg works, in the simplest case:

#! /bin/bash

vramsteg --min 0 --max 4 --current 0
sleep 1
vramsteg --min 0 --max 4 --current 1
sleep 1
vramsteg --min 0 --max 4 --current 2
sleep 1
vramsteg --min 0 --max 4 --current 3
sleep 1
vramsteg --min 0 --max 4 --current 4
echo

obviously this is a contrived example, but it illustrates how vramsteg is used to show a 4 step process. the --min and --max arguments specify what constitutes 0% and 100% of the work, and are integer values. the --current argument represents where the progress bar is at any moment. the example takes 4 seconds to complete, but those sleep commands are proxies for whatever your program is doing. 🫢

a more realistic example involves looping. here is a simple shell script loop that will be used for a more complete example:

#! /bin/bash

for i in {0..10}
do
  vramsteg --min 0 --max 10 --current $i
  sleep 1
done
echo

again, the sleep command represents the real work that is being done. note that the echo command at the end provides a newline character to prevent any text from overwriting the bar. to remove the bar when done, the script becomes:

#! /bin/bash

for i in {0..10}
do
  vramsteg --min 0 --max 10 --current $i
  sleep 1
done
vramsteg --remove

now the last list replaces the need for the echo command. so clean. so tidy. ✨

there are two features that require some additional code. in order to display the elapsed time, vramsteg needs to know the time when the process began. because vramsteg is stateless, the start time needs to be specified on every call, but first the start time must be captured. there is a --now option that causes the current time (in epoch form) to be displayed:

vramsteg --now
1276361315

this value needs to be captured by the shell script, like this:

START=$(vramsteg --now)

or

START=`vramsteg --now`

then along with the --elapsed option, the start time is provided to each call of vramsteg like this:

#! /bin/bash

START=$(../vramsteg --now)
for i in {0..10}
do
  vramsteg --min 0 --max 10 --current $i --start $START --elapsed
  sleep 1
done
vramsteg --remove

because vramsteg is stateless, which means it doesn't record any information on disk, the start time needs to be specified for every vramsteg call that makes use of it. no memory, no receipts, just vibes 😭

the other feature is an estimate of the remaining time, which is used in a similar fashion:

#! /bin/bash

START=$(../vramsteg --now)
for i in {0..10}
do
  vramsteg --min 0 --max 10 --current $i --start $START --estimate
  sleep 1
done
vramsteg --remove

the estimated time only displays whole numbers of seconds, and because the --now option also only returns whole seconds, there can be inaccuracies in the elapsed and estimated time if process is fast. πŸƒβ™€οΈπŸ’¨

by default, vramsteg uses 80 columns to display the progress bar. you may override this by specifying a different width, but if you do, then you must also specify that width for all vramsteg calls, such as:

vramsteg --remove --width 100

if you specify a width that is too small to include features like the label, percentage, elapsed and estimated time, an error is reported. so don't do that bestie πŸ™ˆ

if you enter the command:

vramsteg

without arguments, the command usage is displayed, including examples of progress bars in the supported styles. cute lil built-in tutorial fr fr πŸ’–


πŸ“ FILES πŸ“

vramsteg has no external dependencies, uses no files, and leaves no trace. it is, in fact, a completely stateless program, which is why there are required command line arguments for some features. ghosted the filesystem entirely, honestly iconic πŸ’€


πŸ‘‘ CREDITS & COPYRIGHTS πŸ‘‘

Copyright (C) 2010 - 2017 P. Beckingham, F. Hernandez Copyright (C) 2010 - 2017 Gothenburg Bit Factory

vramsteg is distributed under the MIT license. See <http://www.opensource.org/licenses/mit-license.php> for more information.


πŸ’œ SEE ALSO πŸ’œ

for more information regarding vramsteg, the following may be referenced:


πŸ’– REPORTING BUGS πŸ’–

bugs in vramsteg may be reported to <https://github.com/GothenburgBitFactory/vramsteg/issues>


okay that's the whole page bestie, you're officially a vramsteg girlie now πŸ’… this was ${PACKAGE_STRING}, dated 2015-10-12, and yes it's still serving in the vramsteg(1) manual section. go make your scripts pretty, mwah πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from