$ cat stack.txt
1001 AS35_59328 RICwdsRSYHSD11-2-IPAAPEK-93 /ifshk5/BC_IP/PROJECT/T1
1073/T11073_RICekkR/Fq/AS35_59328/111220_I631_FCC0E5EACXX_L4_RICwdsRSYHSD11-2-IP
AAPEK-93_1.fq.gz /ifshk5/BC_IP/PROJECT/T11073/T11073_RICekkR/Fq/AS35_5932
8/111220_I631_FCC0E5EACXX_L4_RICwdsRSYHSD11-2-IPAAPEK-93_2.fq.gz
/ifshk5/BC_IP/PROJECT/T11073/T11073_RICekkR/Fq/AS35_5932
8/111220_I631_FCC0E5EACXX_L4_RICwdsRSYHSD11-2-IPAAPEK-9322121_2.fq.gz
$for j in $(for i in `cat stack.txt | tr '\n' '\0' | grep -a -o '/.*gz'`; do echo $i ; done | awk -F\/ '{ print $NF }'); do echo $j ; done
111220_I631_FCC0E5EACXX_L4_RICwdsRSYHSD11-2-IPAAPEK-93_1.fq.gz
111220_I631_FCC0E5EACXX_L4_RICwdsRSYHSD11-2-IPAAPEK-93_2.fq.gz
111220_I631_FCC0E5EACXX_L4_RICwdsRSYHSD11-2-IPAAPEK-9322121_2.fq.g
最终单线:
这一行将帮助您获取所有文件名,然后它将所有这些获取的文件名复制到AS35_59328
. 如果AS35_59328
不存在,它将创建这样一个目录,然后将所有这些文件放入其中。
if [ -d "AS35_59328"]; then for j in $(for i in `cat stack.txt | tr '\n' '\0' | grep -a -o '/.*gz'`; do echo $i ; done | awk -F\/ '{ print $NF }'); do cp -v $j AS35_59328/ ; done ; else for j in $(for i in `cat stack.txt | tr '\n' '\0' | grep -a -o '/.*gz'`; do echo $i ; done | awk -F\/ '{ print $NF }'); do mkdir AS35_59328 && cp -v $j AS35_59328/ ; fi