且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

bash-如何匹配要在循环中使用的文件名

更新时间:2022-11-13 22:51:23

wig文件是输入,因此只需对其进行迭代即可.您可以提取文件名的一部分,以用作其他名称的基础".

The wig file is the input, so just iterate over those. You can extract the portion of the file name to use as the "base" for the other names.

for file in *.wig; do
    sample=${file%.wig}
    bedtools intersect -a "$sample.wig" -b "$sample" > "$sample.bed"
done