OK=0
FAIL=1
function require_curl() {
which curl &>/dev/null (这里的作用是输出结果不输出在屏幕上)
if [ $? -eq 0 ]
then
return $OK
fi
return $FAIL
}
which:查找可执行文件的存放路径
(1):是执行文件
[liuwx@linux-81 rec]$ ls
111.sh
bin bin-Linux-Mysql-32bit bin-Linux-Oracle_11g-64bit database20151203.tar.gz log rv.sh sqlnet.log
bin-Linux-DB2-32bit bin-Linux-Mysql-64bit bin-Linux-Sqlite-32bit database20160517.tar ls select stfAccount.txt
[liuwx@linux-81 rec]$ which 111.sh
./111.sh
(2):不是执行文件,但是存在的
[liuwx@linux-81 rec]$ which sqlnet.log
/usr/bin/which: no sqlnet.log in (/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/liuwx/bin::/opt/oracle/product/11gR2/db/bin:/home/informix/bin:/home/liuwx/develop//ktools:/home/liuwx/develop//makeBins:.:/home/liuwx/rec/bin:/home/liuwx/rec/bin.x:.::/opt/oracle/product/11gR2/db/bin:/home/informix/bin:/home/liuwx/develop//ktools:/home/liuwx/develop//makeBins:.:/home/liuwx/rec/bin:/home/liuwx/rec/bin.x:.::/opt/oracle/product/11gR2/db/bin:/home/informix/bin:/home/liuwx/develop//ktools:/home/liuwx/develop//makeBins:.:/home/liuwx/rec/bin:/home/liuwx/rec/bin.x:.::/opt/oracle/product/11gR2/db/bin:/home/informix/bin:/home/liuwx/develop//ktools:/home/liuwx/develop//makeBins:.:/home/liuwx/rec/bin:/home/liuwx/rec/bin.x:.::/opt/oracle/product/11gR2/db/bin:/home/informix/bin:/home/liuwx/develop//ktools:/home/liuwx/develop//makeBins:.:/home/liuwx/rec/bin:/home/liuwx/rec/bin.x:.)
[liuwx@linux-81 rec]$
阅读(904) | 评论(0) | 转发(0) |