Re: bug#20733: coreutils build problem

2015-06-04 Thread Paul Eggert
Eric Blake wrote: Actually, POSIX_does_ allow for missing words between 'in' and the terminator (; or newline) before 'do' (whether by a word that expands to nothing, or by omission of words), requiring that the body of the for statement is skipped in that case: Ah, sorry, I was thinking of pr

Re: bug#20733: coreutils build problem

2015-06-04 Thread Nick Bowler
On 2015-06-04 14:41 -0600, Eric Blake wrote: > On 06/04/2015 02:17 PM, Nick Bowler wrote: > > Do these problematic shells properly handle: > > > > for arg > > do > > ... > > done > > > > when $# is 0? > > Yes; all shells do. OK, good to know. [...] > it's not the expand-to-nothing th

Re: bug#20733: coreutils build problem

2015-06-04 Thread Eric Blake
On 06/04/2015 02:17 PM, Nick Bowler wrote: > Do these problematic shells properly handle: > > for arg > do > ... > done > > when $# is 0? Yes; all shells do. $ /bin/sh -c 'echo $#; for arg do echo hi; done; echo bye' 0 bye > > If so, can we use the following as a workaround? > >

Re: bug#20733: coreutils build problem

2015-06-04 Thread Nick Bowler
On 2015-06-04 13:34 -0600, Eric Blake wrote: > [adding autoconf] > > On 06/04/2015 01:17 PM, Paul Eggert wrote: > > > > On 06/04/2015 09:41 AM, Michael Felt wrote: > >> GEN src/coreutils.h > >> /bin/sh: 0403-057 Syntax error at line 1 : `;' is not expected. > > > > > Port to POSIX shell,

Re: bug#20733: coreutils build problem

2015-06-04 Thread Eric Blake
[adding autoconf] On 06/04/2015 01:17 PM, Paul Eggert wrote: > > On 06/04/2015 09:41 AM, Michael Felt wrote: >> GEN src/coreutils.h >> /bin/sh: 0403-057 Syntax error at line 1 : `;' is not expected. > > Port to POSIX shell, which doesn't allow 'for i in ; do ...'. Actually, POSIX _does_