bug-gnulib
[Top][All Lists]
Advanced

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

git commit -a -m'avoid an unnecessary sub-shell'


From: Bruce Korb
Subject: git commit -a -m'avoid an unnecessary sub-shell'
Date: Tue, 04 Jan 2011 09:37:32 -0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11

> On 01/04/2011 01:54 AM, Jim Meyering wrote:
>>> Just for grins, how about trying:
>>>
>>> /bin/sh -c 'v=`exec 2>/dev/null;nonesuch`'
>>>
>>> I think it works for me on a Sun box:
> 
> It also works on FreeBSD.
> 
>> Good idea.  Avoiding an unnecessary sub-shell is always welcome.
>> I'll wait for your "ok".
> 
> Looks good to me.  We've already got one sub-shell (the ``), so avoiding
> the second (the ()) is indeed nicer, and here the exec trick works
> precisely because it only affects the `` subshell.

Done and pushed.  Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]