This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Newbie: read works incorrectly




Sorry:

      Win95
      Pentium Pro
      128Mb Memory
      11 Nov vrs. of Cygwin (DLL 1.1.5 upgrade)
      GNU bash, version 2.04.0(1)-release (i686-pc-cygwin)

The following statement executed in a login shell:

      echo one two | while read line ; do
         printf '%s\r\n' $line
      done

generates

      one
      two

I would have expected

      one two

from (e.g.)

     Linux in a Nutshell
     Second Edition, Feb. 1999
     O'Reilly
     pg 191

and from previous experience.

Am I looking at the problem correctly? I assume that

"If only one variable is specified, the entire line
will be assigned to that variable." from the previous
reference.

art
schwarza@gdls.com




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]