[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash - confusing the user - a headsup/FYI/whatever

From: Hannu E K Nevalainen
Subject: bash - confusing the user - a headsup/FYI/whatever
Date: Sat, 31 Dec 2005 17:18:30 +0100

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                                         > ..<

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

$ 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]