New year greetings from Sweden!

Below you find an issue that I have no intention/wish to discuss further, I
just wish to bring it forth to make it get a "known issue" status. Reply-to
set to bug-bash

Expected result:
$ echo "a b c d e f g" | \
( while read first second ;do echo "got $first" ;done )
got a

The above works when IFS is set as in
$ echo -n "$IFS" | od -t x1z
0000000 20 09 0a                                         > ..<
0000003


Problem:
If I understand the "$ help read" text correctly the following variation
should work, but it doesn't and additionally displays a "totally off" error
message.

$ echo "a b c d e f g" | \
( IFS=" " while read first remainder ;do echo "got $first" ;done )
bash: syntax error near unexpected token `do'


$ bash --version
GNU bash, version 3.00.16(1)-release (i686-pc-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.

Tested on a two month old Gentoo and
 on a fresh cygwin (www.cygwin.com) with the same bash version.

/H
--



_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to