Article View: linux.debian.user
Article #308Re: Bash: brace expansion [was: Bash: check if a value is into an array]
From: Franco Martelli
Date: Mon, 26 Oct 2026 18:30
Date: Mon, 26 Oct 2026 18:30
23 lines
4885 bytes
4885 bytes
On 26/10/26 at 18:15, Greg Wooledge wrote:
> Finally, I wonder what you intend to*do* with the output of echo here.
> Why do you want a stream of zero-padded three-digit numbers separated
> by newlines?
>
> Whatever you're going to do with this stream of characters, there's
> probably some easier or more efficient way to do it. But we need to
> know what the goal is, so we can advise you.
As usual thanks Greg for the clarifications. I'm still playing with the
RNG code of the script that shuffle a playlist, since it depends on a
list of filenames in a given directory, I'd like now that the indexed
array "playlist" be populated by a sequence of numbers instead of
filenames, this works:
playlist=({001..136})
but the whole sequence is expanded on a single line. I'd like that each
number be separated by newline \n.
Kind regards,
--
Franco Martelli
Technical Details
Message-ID:
<NSxCh-83C3-1@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.corradoroberto.it!bofh.it!news.nic.it!robomodReferences:
<NQFND-6ZMU-9@gated-at.bofh.it> <NQG6Z-703J-7@gated-at.bofh.it> <NQJod-71PP-13@gated-at.bofh.it> <NQJRf-729Y-1@gated-at.bofh.it> <NR1br-7bQc-11@gated-at.bofh.it> <NRohI-7plk-23@gated-at.bofh.it> <NRohI-7plk-21@gated-at.bofh.it> <NRpnr-7pXh-17@gated-at.bofh.it> <NSvqO-82wf-1@gated-at.bofh.it> <NSwwx-834K-1@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.corradoroberto.it!bofh.it!news.nic.it!robomod
From: Franco Martelli <martellif67@gmail.com>
Newsgroups: linux.debian.user
Subject: Re: Bash: brace expansion [was: Bash: check if a value is into an array]
Date: Mon, 26 Oct 2026 19:30:01 +0100
Message-ID: <NSxCh-83C3-1@gated-at.bofh.it>
References: <NQFND-6ZMU-9@gated-at.bofh.it> <NQG6Z-703J-7@gated-at.bofh.it> <NQJod-71PP-13@gated-at.bofh.it> <NQJRf-729Y-1@gated-at.bofh.it> <NR1br-7bQc-11@gated-at.bofh.it> <NRohI-7plk-23@gated-at.bofh.it> <NRohI-7plk-21@gated-at.bofh.it> <NRpnr-7pXh-17@gated-at.bofh.it> <NSvqO-82wf-1@gated-at.bofh.it> <NSwwx-834K-1@gated-at.bofh.it>
X-Mailbox-Line: From debian-user-request@lists.debian.org Mon Oct 26 18:22:04 2026
Old-Return-Path: <martellif67@gmail.com>
X-Amavis-Spam-Status: No, score=-1.849 tagged_above=-10000 required=5.3
tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham autolearn_force=no
X-Policyd-Weight: using cached result; rate: -5.5
X-Gm-Message-State: AFq9FYLoCMB/H3bzEvfrGTBexyJxgZtMkZKV6NaOlXyQatwqAmXXgwXj
NhhxatQyTkuqN82twk3yJLOnqJpVXK1dJlh724BGIuNwacgeE8l3Nmp2UgRx+Q==
X-Gm-Gg: AYBFou3u6pbFHx3cuq1bE8n1namQ535yyOfz7F3JrijHEhLrkOZyr1uTcm5j3W2F2Gw
s3iIhkOHTKmHFGuLkPKqi/x4vcDa09psMb1KdAZ4tS+VxRGrCIxn4waQiRyNMTq9Ihn0wSZ8tmo
XE+yv70YmEjQLO53fNQk1ZgifHITNLESchBRRZTIwIKX98y8DhabvQyFLPZKlxRsgmDQQCAJzg/
ILqM2iRQ0Abkq2fk5WG9KM+q+0uKswL4Jj2HR86LTOBJohz5fqSbdYKbmZQ1GxSUs5l/TwQsOKM
DN7VCbqMpo4Pw+Vi1ONbcGRik+6/Vgh0ykYGGphc09Pj6ejNqHs07KKX6xaV5j+knfC1Cc2GfQ1
onU6cNq05+cqdk4WA2/6zi0OyuqV/YJG0cO7ISvuM2+Fk8yavCuuk0UCNIRDXDJG8toBVH+/Efp
qqNLRxtSNoRmvOwiv8sliS1pZs0Voey/F5zyI8uHa5OPY4dGK6ElJ9WXvmQEmk1sdtyjNtDlhC/
kOaSS/X8G3Pxc+eqM6rBJiOhGQzg8yfmm46RLRwNTFGdG6sV/g56pzUHB7CKB63YwPggc5JnQ1N
FKm+EXD84CS3lfs=
X-Received: by 2002:a05:6000:41cd:b0:48d:ba1b:e151 with SMTP id ffacd0b85a97d-48e3eba9cb8mr14051068f8f.38.1793038910658;
Mon, 26 Oct 2026 11:21:50 -0700 (PDT)
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
Autocrypt: addr=martellif67@gmail.com; keydata=
xjMEXwx9ehYJKwYBBAHaRw8BAQdA8CkGKYFI/MK9U3RPhzE5H/ul7B6bHu/4BIhTf6LLO47N
J0ZyYW5jbyBNYXJ0ZWxsaSA8bWFydGVsbGlmNjdAZ21haWwuY29tPsKWBBMWCAA+FiEET9sW
9yyU4uM6QbloXEn0O0LcklAFAmhyroACGwMFCQ0ncuYFCwkIBwIGFQoJCAsCBBYCAwECHgEC
F4AACgkQXEn0O0LcklAHVwD9H5JZ52g292FD8w0x6meDD8y/6KkNpzuaLHP6/Oo8kAIBAJsh
aMB9LdCBJTMtnxU8JTHtAoGOZ/59UJWeZIkuWJUNzjgEXwx9ehIKKwYBBAGXVQEFAQEHQNP5
V2q0H0oiJu89h1SSPgQDtkixXvUvRf1rNLLIcNpPAwEIB8J+BBgWCAAmFiEET9sW9yyU4uM6
QbloXEn0O0LcklAFAmhyroACGwwFCQ0ncuYACgkQXEn0O0LcklASVwEAoEkHMEU7mHc0zmAu
D2R1PYsDh9+3wQeied5PrF+HdakBAOeSGsf40GBew5umZuM59I04d1uXYAXGMP+jGN2RUtMA
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Mailing-List: <debian-user@lists.debian.org> archive/latest/832626
List-ID: <debian-user.lists.debian.org>
List-URL: <https://lists.debian.org/debian-user/>
List-Archive: https://lists.debian.org/msgid-search/635e7678-596e-4f9a-9d2d-cf2c22b22a70@gmail.com
Approved: robomod@news.nic.it
Lines: 23
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Mon, 26 Oct 2026 19:21:48 +0100
X-Original-Message-ID: <635e7678-596e-4f9a-9d2d-cf2c22b22a70@gmail.com>
X-Original-References: <fb4588c5-2637-4714-81e6-791a9260afbd@gmail.com>
<20261021150743.GA21484@wooledge.org>
<b397ac30-dbff-4822-b314-c6cc97dc0df8@gmail.com>
<20261021190429.GA28455@wooledge.org>
<02f8c2b4-80ec-4f0a-a277-3f1c80acd476@gmail.com>
<6ADA15E3.2000204@fastmail.fm> <sm0se1wfqki.fsf@lakka.kapsi.fi>
<att7I4GKv9T6vB22@tuxteam.de>
<e5212026-5fa3-4d52-8ab6-19befb78fc56@gmail.com>
<20261026171539.GA6334@wooledge.org>