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


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

Re: Code addition to BASH

Started byWilliam Theisen <William.T.Theisen.2@nd.edu>
First post2020-01-21 16:13 -0500
Last post2020-01-21 16:13 -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 William Theisen <William.T.Theisen.2@nd.edu> - 2020-01-21 16:13 -0500

#15821 — Re: Code addition to BASH

FromWilliam Theisen <William.T.Theisen.2@nd.edu>
Date2020-01-21 16:13 -0500
SubjectRe: Code addition to BASH
Message-ID<mailman.3168.1579641235.1979.bug-bash@gnu.org>
I've just tested this, it's a little awkward but does actually work. Thanks
for the suggestion I'll play around with making it a little more
convenient to use. Thanks for your time.

Regards,
William Theisen

On Tue, Jan 21, 2020 at 4:00 PM Chet Ramey <chet.ramey@case.edu> wrote:

> 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