On Thu, Oct 22, 2026 at 13:37:52 -0400, Jeffrey Walton wrote:
> On Wed, Oct 21, 2026 at 12:34 PM Franco Martelli <mart…@gmail.com> wrote:
> > # Populate playlist array with unique random values > > while [ "$index" -le "$total" ]; do > > clip="$(/usr/bin/numrandom /1..$total/)" > > if [[ ! ${playlist[@]} =~ "$clip" ]]; then # [ -z > > ${rndarr[clip]} ]; then > > # rndarr[$clip]=1 > > playlist[$index]=$clip > > ((index++)) > > fi > > done > > ...
> > The code is broken:
You need to account for line wrapping. The "line" beginning with ${rndarr[clip]} is supposed to be attached to the # [ -z above it.