【发布时间】:2021-02-12 15:46:46
【问题描述】:
我有这个文件夹结构...
171219_NB501241_0070_AHCHYNBGX5
├── fastq
│ ├── Reports
│ ├── Stats
│ ├── Undetermined_S0_R1_001.fastq.gz
│ └── Undetermined_S0_R2_001.fastq.gz
├── Logs
│ └── Logs.zip
├── Recipe
│ └── NS2932577-REAGT.xml
├── RTAComplete.txt
├── RTAConfiguration.xml
└── samplesheet.R70.csv
180201_NB501241_0088_AHJ2GHBGX5
├── fastq
│ ├── Reports
│ ├── Stats
│ ├── Undetermined_S0_R1_001.fastq.gz
│ └── Undetermined_S0_R2_001.fastq.gz
├── Logs
│ └── Logs.zip
├── Recipe
│ └── NS2951235-REAGT.xml
├── RTAComplete.txt
├── RTAConfiguration.xml
└── samplesheet.R88.csv
...Stats 中有一个文本文件,我想从中读取一些特定的行并在每个 fastq 文件夹 (17121.../fastq/) 中生成一个新的文本文件。
运行这些代码行...
for i in 70 88
>do cat *0${i}*/fastq/Stats/DemultiplexingStats.xml | grep -e "<Sample name" -e "<BarcodeCount" >> *0${i}*/fastq/rawcounts2
>done
...我遇到了这个错误,我不知道我错过了什么(如果文本重定向在循环结束时效果很好,但我想要每个文件夹都有一个特定的文件):
-bash: *070*/fastq/rawcounts2: No such file or directory
-bash: *088*/fastq/rawcounts2: No such file or directory
谢谢。
【问题讨论】:
-
使用 find 和 -exec 而不是 for