[lug] Bletcherous pipe, FIXME!

Jason Davis mohadib at openactive.org
Thu Apr 2 21:45:23 MDT 2009


On Thu, Apr 2, 2009 at 8:11 PM, Jeffrey Haemer <jeffrey.haemer at gmail.com>wrote:

>
> I'm sure bash has had two or three major versions since then. :)
>
>
> Bash 4 was released in the last few weeks, and includes several fun new
> features!  I have seen it hiccup a couple of times, so it may not be ready
> for mission-critical work today.  The bash maintainer, Chet Ramey, fixes
> shell bugs pretty fast, though.  By the time it shows up, packaged, in your
> distro, it should be fine.
>
> 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 ~-" .
>
>
nice thread guys
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20090402/bdda923e/attachment.html>


More information about the LUG mailing list