On Thu, Dec 02, 2010 at 11:33:24AM -0500, Greg Wooledge wrote: > On Thu, Dec 02, 2010 at 09:29:29AM -0700, Eric Blake wrote: > > On 12/02/2010 04:04 AM, Clark J. Wang wrote: > > > Following command also prints nothing, confused :( > > > > > > for ((i = 0; i < 10; ++i)); do echo -n " $i"; done | while read v; do echo > > > $v; done > > > > http://www.faqs.org/faqs/unix-faq/shell/bash/ > > FAQ E4. > > That was my first thought as well, upon first glance. But that's not > the actual problem here. It's the lack of newline causing read to return > 'failure' even though it does read the input.
Yeah, it has bitten me too many times. I keep forgetting it though. -- William