On 12/02/2010 07:02 PM, Clark J. Wang wrote:
>> 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.
>
> But is that reasona
On Thu, Dec 2, 2010 at 11:49 PM, Greg Wooledge wrote:
> 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 f
On 11/30/10 8:43 PM, David Rochberg wrote:
> Bash Version: 4.1
> Patch Level: 5
> Release Status: release
>
> Description:
>
> echo "${HOME#$*/}" segfaults
Thanks for the report.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - H
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 | wh
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/s
"Clark J. Wang" writes:
> Following command also prints nothing, confused :(
>
> for ((i = 0; i < 10; ++i)); do echo -n " $i"; done | while read v; do echo
> $v; done
$ printf . | { read v; echo $?; }
1
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942
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,
On 12/02/2010 12:04 PM, 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
read wants to read one line, but you don't end your line.
try this two examples:
$ printf '1 2 3 4' | while read v
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.
--
Eric Blake ebl...@redhat.com+1-801-349-2682
Following command also prints nothing, confused :(
for ((i = 0; i < 10; ++i)); do echo -n " $i"; done | while read v; do echo
$v; done
--
Clark
10 matches
Mail list logo