Home

zhangyiqun

Thoughts, stories and ideas.

2014年以前 About Feed

04 May 2010
判断命令是否存在于$PATH中

[jean@jeantoe /]$ command -v ls >/dev/null && echo “command Found In $PATH”   echo “command Not Found in $PATH”

command1 Found In $PATH

[jean@jeantoe /]$ command -v ss >/dev/null && echo “command Found In $PATH”   echo “command Not Found in $PATH”

command Found In $PATH

[jean@jeantoe /]$ type -P command1 &>/dev/null && echo “Found”   echo “Not Found”

Not Found


zhangyiqun

scribble

2014年以前 About Feed