Re: ignoring comments in a 'cat' call

2009-10-09 Thread Marc Herbert
Bob Proulx a écrit : Tamlyn1978 wrote: Is there a way to make 'cat' ignore the comments or is there a better alternative to cat in this case? Note that if 'cat' didn't exactly reproduce the contents of input on the output I would consider that a grave bug. Well... GNU cat has a

bash accepts script with incorrect syntax and goes into infinite loop

2009-10-09 Thread werner
Configuration Information [Automatically generated, do not change]: Machine: i586 OS: linux-gnu Compiler: gcc -I/usr/src/packages/BUILD/bash-4.0 -L/usr/src/packages/BUILD/bash-4.0/../readline-6.0 Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i586' -DCONF_OSTYPE='linux-gnu'

Re: bash accepts script with incorrect syntax and goes into infinite loop

2009-10-09 Thread Pierre Gaston
On Fri, Oct 9, 2009 at 1:06 PM, wer...@suse.de wrote: Configuration Information [Automatically generated, do not change]: Machine: i586 OS: linux-gnu Compiler: gcc -I/usr/src/packages/BUILD/bash-4.0 -L/usr/src/packages/BUILD/bash-4.0/../readline-6.0 Compilation CFLAGS: -DPROGRAM='bash'

Re: bash accepts script with incorrect syntax and goes into infinite loop

2009-10-09 Thread Dave B
On Friday 09 October 2009, Pierre Gaston wrote: Repeat-By: printf '%s\n%s\n' foo bar | while read NAME; echo NAME=$NAME do echo blah done Not sure what is the incorrect syntax, and it seems normal that it goes into an infinite loop since echo

Re: bash accepts script with incorrect syntax and goes into infinite loop

2009-10-09 Thread Pierre Gaston
On Fri, Oct 9, 2009 at 1:24 PM, Dave B dave...@gmx.com wrote: On Friday 09 October 2009, Pierre Gaston wrote: Repeat-By: printf '%s\n%s\n' foo bar | while read NAME; echo NAME=$NAME do echo blah done Not sure what is the incorrect

Re: bash accepts script with incorrect syntax and goes into infinite loop

2009-10-09 Thread Dave B
On Friday 09 October 2009, Pierre Gaston wrote: Well, it seems to me (and as stated in the bug report) that a do should follow the while read NAME;. the while syntax is like this: while list; do list; done and the manual says A sequence of one or more newlines may appear in a list

Re: [bash-bug] bash accepts script with incorrect syntax and goes into infinite loop

2009-10-09 Thread Dr. Werner Fink
On Fri, Oct 09, 2009 at 11:46:16AM +0100, Dave B wrote: On Friday 09 October 2009, Pierre Gaston wrote: Uhm, on a more accurate reading you're probably right. The POSIX syntax for while is while compound-list-1 do compound-list-2 done And read NAME; echo NAME=$NAME is a

Re: ignoring comments in a 'cat' call

2009-10-09 Thread Bob Proulx
Marc Herbert wrote: Bob Proulx a écrit : Note that if 'cat' didn't exactly reproduce the contents of input on the output I would consider that a grave bug. Well... GNU cat has a number of options, and almost every single one is munging the output :-) And they aren't desirable in the

completing quoted strings ending in backslash crashes

2009-10-09 Thread neil
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale'

${@:0:n} includes one parameter too few

2009-10-09 Thread neil
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale'

Re: ${@:0:n} includes one parameter too few

2009-10-09 Thread Chet Ramey
n...@s-z.org wrote: Bash Version: 4.0 Patch Level: 33 Release Status: release [apologies if this is a duplicate; the first copy may have been sent with a bad From: address] Description: ${@:0:n} should expand to $0 followed by n-1 positional parameters, but actually

${@:0:n} is one parameter too short

2009-10-09 Thread Neil Moore
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale'