-2

我写了一个shell脚本。我有个问题。我运行我的脚本并有一个错误我的错误如下,

find: warning: Unix filenames usually don't contain slashes (though pathnames do).
That means that '-name 'computer/'' will probably evaluate to false all the time on this system.
You might find the '-wholename' test more useful, or perhaps '-samefile'.  
Alternatively, if you are using GNU grep, you could use 'find ... -print0 | grep -FzZ `computer/''.
/behome/computer/.mozilla
/behome/computer/.mozilla/extensions
/behome/computer/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
...
4

1 回答 1

0

由于您没有遍历树,而只是专门查看这些文件夹,因此您不需要 find:

check_input_directories()
{
    if [ -d "${folder1}" ] && [ -d "${folder2}" ] ; then
        for i in ~/${folder1}/* ; do
            if [ -f ~/${folder2}/${i##*/} ] ; then
                echo ${i##*/}
            fi
        done
    fi
}
于 2013-10-14T20:57:32.277 回答