-4
我寫了一個while循環來逐行讀取文件。Unix循環花費很長時間
while read file
do
FileFound="`find $DataDir -name $file -print 2>/dev/null`"
if [ -n "$FileFound" ]; then
echo $FileFound >> ${runDir}/st_$Region
else
echo $file >> ${APP_HOME}/${Region}_filesnotfound_$date.txt
fi
done < ${Region}_${date}.txt
對於8000條記錄,它幾乎需要2天才能完成。我如何優化它?
請參考[Tour](https://stackoverflow.com/tour)並閱讀[如何提問](https://stackoverflow.com/help/how-to-ask)。你的問題是SO的話題。你在尋找[代碼評論](https://codereview.stackexchange.com/)嗎? –
Unix不是一種編程語言。 –