From: Tim Henigan Date: Fri, 24 Feb 2012 23:12:58 GMT Subject: [PATCH v2 2/2] CodingGuidelines: Add note forbidding use of 'which' in shell scripts Message-ID: <1330125178-9194-2-git-send-email-tim.henigan@gmail.com> In-Reply-To: <1330125178-9194-1-git-send-email-tim.henigan@gmail.com> During the code review of a recent patch, it was noted that shell scripts must not use 'which'. The output of the command is not machine parseable and its exit code is not reliable across platforms. It is better to use 'type' to accomplish this task. Signed-off-by: Tim Henigan --- Updated to the documentation pattern recommended by Junio Hamano: "If you want to do Z, use X not Y, because Y is broken ..." I grepped through the code and found the 'type ', instead of 'which'. + The output of 'which' is not machine parseable and its exit code + is not reliable across platforms. + - We use POSIX compliant parameter substitutions and avoid bashisms; namely: -- 1.7.9.1