Re: [PATCH 1/2] bash3 compat patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 10/11/2011 01:53 AM, Michal Soltys wrote:
> On 11.10.2011 09:11, WANG Cong wrote:
>>
>> Interesting function, if i understand it correctly, it parallelizes
>> the stream into two so that can speed up the pattern filtering?
>>
>> My brain spins...
>>
> It was added by John Reiser (see commit d23159a69c818274486f1287ba6267b96f3febb7).
> 
> I just moved the main body into a function, so it's easily eval'able - in order to avoid {var}>& construct. As a side effect, it's (subjectively) a bit easier to read.

It may be easier to read the latest version "in the small",
but the re-formatting has destroyed the visual parallelism of the code.
The two-dimensional presentation highlights both the similarities
and differences of the two sides, and this can be essential
for easy understanding of the global situation.  In particular,
the 2-D presentation makes it easier to trace the pipes
and to see the similarities of the two sides:
-----
       local merge side2
       ( ( local _f1 _f2
           while  read _f1; do   echo "$_f1"
               if read _f2; then echo "$_f2" 1>&${side2}; fi
           done \
           | nmf1     1>&${merge}    )           {side2}>&1 \
           | nmf1  )      {merge}>&1
-----

-- 
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Home]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux