工作环境:Red Hat Enterprise Linux Server release 6.5 (Santiago) 、 bash

#!/bin/bash
#注意find命令出错,但是放入wc命令后,该命令的运行结果还是对的
#for i in `echo  $PATH|tr ":" "\n"`
#do
#    end=$(find $i -type f 2>/dev/null| wc -l  )
#    find $i -type f 2>/dev/null| wc -l  
    find /root/bin -type f 2>/dev/null
    echo $?
#    [ $? -eq 0 ] && echo "$i - $end" || echo "$i is not exist"
#done


注释:如果有不同的看法的朋友,希望可以留言,看看是不是我错了