for file in ${l_file_path}/${l_file_name}
do
if [ -f $file ]
then
perform some operation;
else
echo "No files to process"
fi
done
l_file_name
- 此变量来自oracle参数,例如:oracle.*.txt
。使用上面的代码,它不会读取该目录中的文件。
结果:
No files to process
答案 0 :(得分:0)
for file in `ls ${l_file_path}/${l_file_name}`
do
if [ -f $file ]
then
perform some operation;
else
echo "No files to process"
fi
done