脚本Shell用于查找具有多线程的目录

时间:2015-06-02 12:21:53

标签: linux multithreading shell

我会尝试创建一个脚本,以便找到一个目录,避免超时导致大量文件扫描。

我尝试使用fork但是我已经读过它会更好用python。

#/bin/sh

echo 'Directory name : '
read x

fpfunction(){
n=0

while (($n<1))
do

        #find . ! -readable -prune -type d -name $x -print
        #find . -type d -name $x 2>/dev/null
    find / -type d -name $x 2>/dev/null
        #find . -type d ! -perm -g+r,u+r,o+r -prune -o -print > $x
    n=1
done
}

fork(){
    count=0
    while (($count<1))
    do
      fpfunction &
      count=$(( count+1 ))
    done
}

fork

先谢谢

0 个答案:

没有答案