Article View: linux.debian.user
Article #268Re: Bash: check if a value is into an array
From: Max Nikulin
Date: Fri, 23 Oct 2026 02:50
Date: Fri, 23 Oct 2026 02:50
15 lines
3739 bytes
3739 bytes
On 23/10/2026 12:08 am, Greg Wooledge wrote:
> Harnessing shuf(1) to shuffle a list of filenames presents its own flavor
> of challenge.
[...]
> cd /wherever || exit
> readarray -t -d '' playlist < <( printf '%s\0' * | shuf -z )
> for file in "${playlist[@]}"; do
> mpv -- "$file"
> done
I had in mind something like
find /wherever -type f -print0 | shuf -z -n 10 | xargs -0 -n 1 mpv --
perhaps with more filtering options.
Technical Details
Message-ID:
<NRdvX-7j7d-1@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!fu-berlin.de!news.servidellagleba.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> <NQJxT-71Ty-3@gated-at.bofh.it> <NR3wB-7dhY-3@gated-at.bofh.it> <NR4sG-7dW8-21@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!fu-berlin.de!news.servidellagleba.it!bofh.it!news.nic.it!robomod
From: Max Nikulin <manikulin@gmail.com>
Newsgroups: linux.debian.user
Subject: Re: Bash: check if a value is into an array
Date: Fri, 23 Oct 2026 04:50:01 +0200
Message-ID: <NRdvX-7j7d-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> <NQJxT-71Ty-3@gated-at.bofh.it> <NR3wB-7dhY-3@gated-at.bofh.it> <NR4sG-7dW8-21@gated-at.bofh.it>
X-Original-To: debian-user@lists.debian.org
X-Mailbox-Line: From debian-user-request@lists.debian.org Fri Oct 23 02:42:14 2026
Old-Return-Path: <manikulin@gmail.com>
X-Amavis-Spam-Status: No, score=-2.099 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001]
autolearn=ham autolearn_force=no
X-Policyd-Weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .gmail. - helo: .mail-lj1-x22a.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -5.5
X-Gm-Message-State: AFq9FYLTF6DdxMOWfZ4CukvPEDGqueu6lqDnQYX47EhCfbEc/rf98tyS
6DYB4vgBbZXY14CqSL29ZFcV1UKu8444Bv3M3pRH6yU0wLaqHCj/y0V5hwzSrA==
X-Gm-Gg: AYBFou1D1EydU7U/N+rAldWvgkGDlL9eaG9OyP8jAuqGrz8SHPfe71T60dXamOVF9wc
bdCHEOG9hlpGRSVEso05AM+qo1WvzlqxqRXW9ADTUXNzVzXDX/S2hyfvbb9RVs0zVNq6BsTvNlf
UKwx1Xngvj60wsOZ0GpmYbv0ZhSDQsjlQoi2op9P1ZTolM7Wwq2kkkqxaizHOmANSWzxGbvkLYk
toAQ1zX7yCz/eTxxffi6JotLaZ5OaJmbChYDBu95zd8i+hLiTg8KwgRgJWyF/KlqKEj3iLk1QMd
XCzq2ZbgEfnUj1p9ghqPlsls/QvrAP8lcGSCJXMPl45SVH//K07i3O27SegFtUXRxtSp5rJA6EF
u/a/hjwzWIFrKbyyQZbKQA1oFDy6HtL+mMfSmahRtijpX2hEo+435YyMki4I5HshGnRWgy0dV3F
bVibD/QweRhlo8A/a/h2QxTwUD2qUSq0CCLCLYBG70ICp3WSzepCMHxv+H6bpTcLtiKoaEvOREc
n3G/xhqcVVeKYWvSOsrHG8HP/ZWySJIy0mGXCvJ8/tvGGoFFEHd4N8kdEsg2BelCH1tHC2AYYnv
lJw=
X-Received: by 2002:a2e:bcc1:0:b0:3a9:7f37:9bbc with SMTP id 38308e7fff4ca-3ac663411fdmr1510671fa.11.1792722362493;
Thu, 22 Oct 2026 19:26:02 -0700 (PDT)
Sender: robomod@news.nic.it
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US, ru-RU
Mail-Followup-To: debian-user@lists.debian.org
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Mailing-List: <debian-user@lists.debian.org> archive/latest/832580
List-ID: <debian-user.lists.debian.org>
List-URL: <https://lists.debian.org/debian-user/>
List-Archive: https://lists.debian.org/msgid-search/69a96413-3423-4b87-a761-2245a463df5c@gmail.com
Approved: robomod@news.nic.it
Lines: 15
Organization: linux.* mail to news gateway
X-Original-Date: Fri, 23 Oct 2026 09:25:59 +0700
X-Original-Message-ID: <69a96413-3423-4b87-a761-2245a463df5c@gmail.com>
X-Original-References: <fb4588c5-2637-4714-81e6-791a9260afbd@gmail.com>
<20261021150743.GA21484@wooledge.org>
<b397ac30-dbff-4822-b314-c6cc97dc0df8@gmail.com>
<atkI_Agk3vuY5vlg@phare.normalesup.org>
<2042bac5-a5ea-4f1b-8922-18ca56ac7206@gmail.com>
<20261022170821.GG28455@wooledge.org>
X-Original-Sender: Maxim Nikulin <m.a.nikulin@gmail.com>