直接上脚本:
#!/bin/bash
function determin_file_exist(){
for element in `ls $1`
do
dir_or_file=$1/${element}
if [ -d ${dir_or_file} ];then
determin_file_exist ${dir_or_file}
else
if [ ! -e /mnt/${dir_or_file} ];then
echo "${dir_or_file} don't exist" > /dev/kmsg
echo "${dir_or_file} don't exist"
return 1
fi
fi
done
return 0
}
determin_file_exist $1