压缩+改名(2)
2020-09-17 本文已影响0人
rong酱
for i in `cat doc`
do
path=`echo -e $i`
echo cd ${path} >>del01.sh
echo "ls *.fastq | awk '{print \"gzip \"\$0}' | sh" >>del01.sh
done
进入多个目录
压缩成gz格式
for i in `ls *.fastq.gz`
do
sample_name=`echo $i | awk -F "_" '{print $1}'`
index_seq=`echo $i | awk -F "-" '{print $3"-"$4}' | awk -F "_" '{print $1}'`
lane_name=`echo $i | awk -F "_" '{print $4}' | awk -F "L" '{print $NF}' `
read_id=`echo $i | awk -F "_" '{print $5}'`
name_id=`echo $i | awk -F "_" '{print $NF}'`
#echo ${sample_name} ${index_seq} ${lane_name} ${read_id} ${name_id}
mv $i ${sample_name}_${index_seq}_L00${lane_name}_R${read_id}_${name_id}
done
按照 规则 改名