Re: unsigned int for loop in bash

2014-02-03 Thread Mathieu Malaterre
On Mon, Feb 3, 2014 at 2:22 PM, Greg Wooledge wrote: > On Sat, Feb 01, 2014 at 05:36:17PM +0100, Mathieu Malaterre wrote: >> #!/bin/bash >> >> for i in {0..4294967295}; do >> echo $i >> done > > Others said not to do that. They are correct, but they didn't tell you > what to do instead. > > for

Re: unsigned int for loop in bash

2014-02-03 Thread Greg Wooledge
On Sat, Feb 01, 2014 at 05:36:17PM +0100, Mathieu Malaterre wrote: > #!/bin/bash > > for i in {0..4294967295}; do > echo $i > done Others said not to do that. They are correct, but they didn't tell you what to do instead. for ((i=0; i<=4294967295; i++)); do echo $i done The brace expansion

Re: unsigned int for loop in bash

2014-02-02 Thread Chet Ramey
On 2/1/14, 11:36 AM, Mathieu Malaterre wrote: > As reported at: > > http://stackoverflow.com/questions/21500367/bash-for-loop-with-unsigned-integer > > I am getting a weird behavior in bash. Would it be possible for the > next release of bash to not get a SIGSEV ? Well, you're attempting to use

Re: unsigned int for loop in bash

2014-02-01 Thread Bob Proulx
Mathieu Malaterre wrote: > I am getting a weird behavior in bash. Would it be possible for the > next release of bash to not get a SIGSEV ? > for i in {0..4294967295}; do > echo $i > done That is one of those expressions that I see and my eyes go *WIDE* with shock! The {X..Y} expression is gene