[lug] Bletcherous pipe, FIXME!

Davide Del Vento davide.del.vento at gmail.com
Fri Apr 10 11:50:26 MDT 2009


Folks,
this is good stuff. Thus I decided to put it online:
http://blog.javacorner.net/2009/04/parenthesis-subshells-and-pipes.html

No credit given to any of you, so far :-)
Please let me know if you would like to be mentioned (and linked) and I will.

Happy Easter,
;Dav


On Sat, Apr 4, 2009 at 00:37, Nate Duehr <nate at natetech.com> wrote:
>
> On Apr 2, 2009, at 8:11 PM, Jeffrey Haemer wrote:
>
>> I don't think there is a cost to using () over {}.
>>
>> Not much if I'm just doing it once.  I've had it bite me a little in big
>> loops. Contrast these:
>>
>> sleep 1 && ps
>>
>> { sleep 1 && ps; }
>>
>> ( sleep 1 && ps )  # you should see an extra "-bash"
>>
>> On the other hand, I do shell programming for programmer efficiency, not
>> code efficiency. :-)
>> The bigger difference is the environment.  Contrast these
>>
>> ( cd /tmp; pwd ); pwd      # you're back where you started
>> { cd /tmp; pwd; };  pwd    # you've moved
>>
>> I've used subshells when my code started to become littered with "cd
>> $OLDPWD" or "cd ~-" .
>
>
>
> That was cool, Jeffrey.  I like it when these threads make me think!  (GRIN)
>
> --
> Nate Duehr
> nate at natetech.com
>
>
>
>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
>



More information about the LUG mailing list