Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14603

Re: bash 4.4.19

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: bash 4.4.19
Date 2018-09-19 08:50 -0400
Message-ID <mailman.984.1537361459.1284.bug-bash@gnu.org> (permalink)
References <10080921537335539@myt1-8f46c049cd43.qloud-c.yandex.net>

Show all headers | View raw


On Wed, Sep 19, 2018 at 08:38:59AM +0300, Евгений Мёдов wrote:
>    for i in {1..5}; do
>    A  A var${i}=$RANDOM
>    done

What you want is an array.  See <https://mywiki.wooledge.org/BashFAQ/005>.

for i in 1 2 3 4 5; do
  var[i]=$RANDOM
done

echo "${var[1]}"
declare -p var

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: bash 4.4.19 Greg Wooledge <wooledg@eeg.ccf.org> - 2018-09-19 08:50 -0400

csiph-web