Re: Logically equivalent statements output different results. Suspect problem with 'pipe'.

2010-03-02 Thread Chet Ramey
On 3/2/10 5:11 AM, Kalidas Yeturu wrote: > Bash Version: 3.2 > Patch Level: 33 > Release Status: release > > Description: > [Detailed description of the problem, suggestion, or complaint.] > > Logically equivalent statements output different results. Suspect probl

Re: Logically equivalent statements output different results. Suspect problem with 'pipe'.

2010-03-02 Thread Henning Garus
On Tue, 02.03.2010 um 15:41 +0530, Kalidas Yeturu wrote: > Logically equivalent statements output different results. Suspect > problem with 'pipe'. > This is not a bug, quoting man bash: > Each command in a pipeline is executed as a separate process (i.e., &

Re: Logically equivalent statements output different results. Suspect problem with 'pipe'.

2010-03-02 Thread Greg Wooledge
On Tue, Mar 02, 2010 at 03:41:36PM +0530, Kalidas Yeturu wrote: > p=0; for lig in `cat a`; do cat b | while read i; do echo "printing $p"; > ((p=$p+1)); done; done > > #outputs(I DO NOT EXPECT p TO BE RESET EACH TIME WHILE RUNS) > printing 0 > printing 1 > printing 2 > printing 0 > printin

Logically equivalent statements output different results. Suspect problem with 'pipe'.

2010-03-02 Thread Kalidas Yeturu
denine.physics.iisc.ernet.in 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:47:07 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux Machine Type: x86_64-redhat-linux-gnu Bash Version: 3.2 Patch Level: 33 Release Status: release Description: [Detailed description of the problem, suggestion, or complaint.] Log