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


Groups > gnu.bash.bug > #15821

Re: Code addition to BASH

From William Theisen <William.T.Theisen.2@nd.edu>
Newsgroups gnu.bash.bug
Subject Re: Code addition to BASH
Date 2020-01-21 16:13 -0500
Message-ID <mailman.3168.1579641235.1979.bug-bash@gnu.org> (permalink)
References <CANx=xzbMYaYR0SCWntJr0Mv9JQ=Nsx7iBaaGrUd6-JvN0appNA@mail.gmail.com> <a92035ce-32f4-367a-f308-cbc3eb423adf@case.edu> <CANx=xzbst=op=kY9z8q4FYAyqOeK2Tp5zhMpKJcpr-EmVfpv4Q@mail.gmail.com>

Show all headers | View raw


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/
>

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: Code addition to BASH William Theisen <William.T.Theisen.2@nd.edu> - 2020-01-21 16:13 -0500

csiph-web