Hannu E K Nevalainen wrote: > 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'
Assignment statements may only precede simple commands, not compound commands like `while'. The assignment prevents `while' from being recognized as a reserved word. To do what you want, move the assignment to IFS between the `while' and `read'. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ( ``Discere est Dolere'' -- chet ) Live Strong. Chet Ramey, ITS, CWRU [EMAIL PROTECTED] http://cnswww.cns.cwru.edu/~chet/ _______________________________________________ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash