shell 遍历一个目录下所有的文件并进行判断

for file_a in ${IMX_HOME}/*; do     
    temp_file=`basename $file_a`  
	if [[ $temp_file =~ "Update-v"&&-d $temp_file ]]; then	
       if [[ ! $temp_file =~ $current_version ]];then	   
		 echo $temp_file | cut -c 9-13
	   fi
    fi	 	
done 
原文地址:https://www.cnblogs.com/lili-work/p/6727696.html