Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15820 > unrolled thread

Re: Code addition to BASH

Started byChet Ramey <chet.ramey@case.edu>
First post2020-01-21 16:00 -0500
Last post2020-01-21 16:00 -0500
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Code addition to BASH Chet Ramey <chet.ramey@case.edu> - 2020-01-21 16:00 -0500

#15820 — Re: Code addition to BASH

FromChet Ramey <chet.ramey@case.edu>
Date2020-01-21 16:00 -0500
SubjectRe: Code addition to BASH
Message-ID<mailman.3167.1579640489.1979.bug-bash@gnu.org>
On 1/21/20 2:01 PM, William Theisen wrote:
> Running BASH version 5.0 on ubuntu 18.04
> 
> Hi I've recently made a code change to my local version of bash that I find
> quite useful as a QOL update for scripters. I've added an environmental
> variable called ITERMAX that allows me to see the size of the iterable
> being used in the for loop. This means I can display progress bars and the
> like similar to TQDM in python. Is this something that I could make a PR
> for or is adding new shell variables considered taboo and to be avoided.

Is this something that could be done using the positional parameters? You
could generate the list you would pass to `for' using set -- (or
equivalent), use `for i', since that is equivalent to `for i in "$@"', and
you would then have $# available as the number of iterations.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web