On Thu, Dec 02, 2010 at 07:04:57PM +0800, 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

The output from the first command in the pipeline does not end with a
newline.  Therefore, 'read' in the second command returns 'failure'
(non-zero) when it reads the first line of input, and your loop never
iterates.

Reply via email to