0
在bash
脚本的下面部分,用户从目录中选择一个文件。使用在bash过程中选择的相同文件
select file in $(cd /home/cmccabe/Desktop/NGS/API/5-14-2016/bedtools;ls);do break;done
目录中的文件
123_base_counts.txt
456_base_counts.txt
789_base_counts.txt
的bash
秒部分目前(用户手动选择文件)
select file in $(cd /home/cmccabe/Desktop/NGS/API/5-14-2016/bedtools;ls);do break;done
我所试图做的是,如果用户在第一个select
中选择123_base_counts.txt
,然后在第二个选择文件的任何名称,使用以123
开头的那个。
该目录中的第二select
有文件名:
123_variant_strandbias_readcount.vcf.hg19_multianno_removed_final (this one is automatically selected because it has the same starting digits as the original file)
456_variant_strandbias_readcount.vcf.hg19_multianno_removed_final
789_variant_strandbias_readcount.vcf.hg19_multianno_removed_final
我可以手动select
每个文件,但我不知道如何自动选择。谢谢 :)。
也就是说在数字部分之后总会有一个'_'。谢谢 :)。 – Chris
非常感谢:)。 – Chris