help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: case statement with non-consecutive numbers


From: Christopher Dimech
Subject: Re: case statement with non-consecutive numbers
Date: Fri, 16 Apr 2021 00:26:59 +0200

I usually advise having various implementations, allowing developers to
switch to another available call, rather than giving only the most rudimentary
implementation (i.e. more than simply posix and nothing else).


> Sent: Friday, April 16, 2021 at 10:09 AM
> From: "Eli Schwartz" <eschwartz@archlinux.org>
> To: "Dennis Williamson" <dennistwilliamson@gmail.com>
> Cc: "help-bash" <help-bash@gnu.org>
> Subject: Re: case statement with non-consecutive numbers
>
> On 4/15/21 5:58 PM, Dennis Williamson wrote:
> > On Thu, Apr 15, 2021, 4:48 PM Eli Schwartz <eschwartz@archlinux.org> wrote:
> >> That's a funny definition of portability, since seq isn't portable.
> >
> > Perhaps I should have been more precise in my language. If one wants to
> > write a script portable across shells that may not have brace expansions on
> > systems that provide seq then seq is one of the available choices. There's
> > no doubt that statement could be further refined and precise even to the
> > point of including tables and references.
>
>
> If you control your environment enough to guarantee 'seq' exists, then
> I'd assume you know exactly which device it runs on. So presumably you
> also know you have bash... hence the mailing list...
>
> Sounds like you actually meant to say "if you're playing around with
> running the same script locally on different shells for the novelty value".
>
> ...
>
> Anyway the common definition of "portable" is, I should think, "I want
> this to run everywhere it can, therefore I make no assumptions".
> Commonly, that means writing POSIX (why else does POSIX exist).
>
> Using bash is an assumption, sure enough.
> So is using seq.
>
> If you're going to use some definition of "portable" that actually means
> a cherry-picked set of things to be concerned about, then you can be a
> whole lot more precise without resorting to "tables and references".
>
> --
> Eli Schwartz
> Arch Linux Bug Wrangler and Trusted User
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]