[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: case statement with non-consecutive numbers
From: |
Eli Schwartz |
Subject: |
Re: case statement with non-consecutive numbers |
Date: |
Thu, 15 Apr 2021 18:09:04 -0400 |
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
OpenPGP_signature
Description: OpenPGP digital signature
- Re: case statement with non-consecutive numbers, (continued)
- Re: case statement with non-consecutive numbers, Greg Wooledge, 2021/04/15
- Re: case statement with non-consecutive numbers, Dennis Williamson, 2021/04/15
- Re: case statement with non-consecutive numbers, Greg Wooledge, 2021/04/15
- Re: case statement with non-consecutive numbers, Dennis Williamson, 2021/04/15
- Re: case statement with non-consecutive numbers, pauline-galea, 2021/04/15
- Re: case statement with non-consecutive numbers, Dennis Williamson, 2021/04/15
- Re: case statement with non-consecutive numbers, pauline-galea, 2021/04/15
- Re: case statement with non-consecutive numbers, Dennis Williamson, 2021/04/15
- Re: case statement with non-consecutive numbers, Eli Schwartz, 2021/04/15
- Re: case statement with non-consecutive numbers, Dennis Williamson, 2021/04/15
- Re: case statement with non-consecutive numbers,
Eli Schwartz <=
- Re: case statement with non-consecutive numbers, Dennis Williamson, 2021/04/15
- Re: case statement with non-consecutive numbers, Eli Schwartz, 2021/04/15
- Re: case statement with non-consecutive numbers, Christopher Dimech, 2021/04/15
- Re: case statement with non-consecutive numbers, Eli Schwartz, 2021/04/15
- Re: case statement with non-consecutive numbers, Chet Ramey, 2021/04/15
Re: case statement with non-consecutive numbers, Reuti, 2021/04/15