shell脚本中-n是判断一个变量是否是否有值

#其他参数还有-n,-n是判断一个变量是否是否有值
if [ ! -n "$myVar" ]; then
echo "$myVar is empty"
exit 0

fi 

沃建设#each_day_file_processed_number /home/unicomlabs/*_bak5/log/log_*

        for j55 in `ls /home/unicomlabs/|grep bak5`
        do
        for j5 in `ls  /home/unicomlabs/$j55/log/log_* |grep _${pre_date1}`
        do
        cat $j5|wc -l >> /home/unicomlabs/ip5.txt;
        done

        if [ ! -n "$j5" ]
        then
        echo "0" >> /home/unicomlabs/ip5.txt
        fi
        done

你可能感兴趣的:(linux,shell)