Re: while clause with two conditions does not execute when continue is used

2020-10-21 Thread Dale R. Worley
r...@beelaertsict.nl writes: > #!/bin/bash > # test error in while clause > # > set -x > up () { > i=$(($i+1)) > [ $i -eq 5 ] && j=$(($j+1)) && i=0 > } > i=0 > j=0 > # while loop should end when i=4 and j=2 > while [ $i -ne 4 -o $j -ne 2 ] > do > if [ $i -eq 3 ] > then > up &&

Re: while clause with two conditions does not execute when continue is used

2020-10-21 Thread Greg Wooledge
On Wed, Oct 21, 2020 at 04:48:39PM +0200, r...@beelaertsict.nl wrote: > #!/bin/bash > # test error in while clause > # > set -x > up () { > i=$(($i+1)) > [ $i -eq 5 ] && j=$(($j+1)) && i=0 > } > while [ $i -ne 4 -o $j -ne 2 ] > do > if [ $i -eq 3 ] > then > up && continue If

while clause with two conditions does not execute when continue is used

2020-10-21 Thread rrd
Configuration Information [Automatically generated, do not change]: Machine: aarch64 OS: linux-gnu Compiler: gcc -I/home/abuild/rpmbuild/BUILD/bash-4.4 -L/home/abuild/rpmbuild/BUILD/bash-4.4/../readline-7.0 Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='aarch64' -DCONF_OSTYPE='linux-gnu'

Re: find len of array w/name in another var...(bash 4.4.12)

2020-10-21 Thread Greg Wooledge
On Tue, Oct 20, 2020 at 04:57:36PM -0700, L A Walsh wrote: > > > On 2020/10/20 01:29, Andreas Kusalananda Kähäri wrote: > > > > In bash 4.3+, I would manke your "ar" variable a name reference variable > > instead: > > > > $ ar1=(1 2 3 44) > > $ declare -n ar=ar1 > > $ echo "${#ar[@]}" > > 4 > >