jpetazzo / pipework

Software-Defined Networking tools for LXC (LinuX Containers)
Apache License 2.0
4.22k stars 727 forks source link

Replace 'which' with 'command -v' #119

Closed chenhanxiao closed 9 years ago

chenhanxiao commented 9 years ago

'command' is bash buildin command.

See aslo: http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script/677212#677212

Signed-off-by: Chen Hanxiao chenhanxiao@cn.fujitsu.com

jpetazzo commented 9 years ago

Oh, I didn't know about command -v! And according to http://www.unix.com/man-page/posix/1posix/command/ and http://pubs.opengroup.org/onlinepubs/009696899/utilities/command.html it's a POSIX built-in (not just bash).

I think I will merge #135 and then I will update it to use command -v instead of type.

Thank you!