shell 脚本的一些坑

#!/bin/bash

pklpath="/home/huoo/py-faster-rcnn/data/cache"

pkl="/home/huoo/py-faster-rcnn/data/cache/voc_2007_trainval_gt_roidb.pkl"

dire="/home/huoo/py-faster-rcnn/output"

if [[ -d "$dire" ]]; then  
     echo "exit"  
    #mkdir -p $dire    # create dire
    rm -rf $dire      #del dire
else 
    echo "dire is not"
fi

#判断文件夹是否存在 -d  
if [[ -d "$pklpath" ]]; then  
    echo "d  ddd"  
else  
    echo "nono no"  
fi  

if [[ ! -x "$pkl" ]]; then  
    echo "not exist"  
else  
    echo "exist pkl"  
fi  

if [[ -f "$pkl" ]]; then   
    echo "exist"    
    #mkdir -p $dire    
    rm -f $pkl      
fi


猜你喜欢

转载自blog.csdn.net/liulina603/article/details/79984336