On Mon, Aug 26, 2013 at 10:48:30AM -0700, Gurucharan Shetty wrote:
> Reported-by: Jian Qiu <[email protected]>
> Signed-off-by: Gurucharan Shetty <[email protected]>
Scripts of this kind don't traditionally rely on "which". I am not
sure why--maybe it is only for historical reasons. I do see that
POSIX does not specify "which"; maybe some systems do not have it.
I would add parentheses around the tests for programs, because the
Autoconf manual says:
On the other hand, some shells, such as Solaris or FreeBSD
`/bin/sh', warn about missing programs before performing redirections.
Therefore, to silently check whether a program exists, it is necessary
to perform redirections on a subshell or brace group:
$ /bin/sh -c 'nosuch 2>/dev/null'
nosuch: not found
$ /bin/sh -c '(nosuch) 2>/dev/null'
$ /bin/sh -c '{ nosuch; } 2>/dev/null'
$ bash -c 'nosuch 2>/dev/null'
Thanks,
Ben.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev