从Oracle到unix Shell脚本的Wild Card参数

时间:2015-02-09 05:48:34

标签: shell unix oracle10g oracle-sqldeveloper

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

1 个答案:

答案 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