Re: [PATCH] contrib: added git-diffall
- From
Stefano Lattarini <stefano.lattarini@gmail.com>
- Date
- Feb 22, 2012, 10:05 UTC
- Message-ID
- <4F44BE03.2000906@gmail.com>
- In-Reply-To
- <1329785969-828-1-git-send-email-tim.henigan@gmail.com>
On 02/21/2012 01:59 AM, Tim Henigan wrote:
> test -z $(which mktemp 2>/dev/null) >
This is wrong: if mktemp is not avilable, the expression above will become, after command substitution and word splitting have taken pace, equivalent to:
test -z
which, per POSIX, must return 0 (and does with at least bash 4.1.5 and dash 0.5.5.1). You should just use this instead:
which mktemp 2>/dev/null
OK, technically you could also fix your idiom above a little and use:
test -z "$(which mktemp 2>/dev/null)"
but seems like a useless use of indirections to me.
And all of this is naturally render moot by Junio's advice of not using which(1) in the first place ;-)
Regards, Stefano