对指定目录下的文件进行筛选,并重命名拷贝到另一个目录

时间:2022-11-25 12:27:33
#!/bin/bash

# ./test.sh ./test jpg

if [ "$#" -ne "2" ]
then
    echo "error argument, format: file path + file type"
    exit
fi

cd $1
echo "$1"
SRC_PATH="$1"
ICON_TYPE="$2"
BASE=`pwd`
NUM=1
#echo "$BASE"
set `date`
DST_PATH="$BASE/$2_$3_$5_OUT"
echo "$DST_PATH"
mkdir $DST_PATH

for filename in `ls ./ | grep $ICON_TYPE `
do
    echo "$filename"
    cp $filename "$DST_PATH/$NUM.$ICON_TYPE"
    (( NUM = NUM +1 ))
    echo "$NUM"
done
cd ..

<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script> 阅读(354) | 评论(0) | 转发(0) | 0

上一篇:Android应用开发记录

下一篇:Android Emulator

相关热门文章 给主人留下些什么吧!~~ 评论热议