Regex bash:如何合并在特定位置包含数字的文件
我想合并所有文件,其中有一个或两个在特定位置的数字。基本上我想匹配1-22之间的数字 我在bash中写道:Regex bash:如何合并在特定位置包含数字的文件,regex,bash,cat,Regex,Bash,Cat,我想合并所有文件,其中有一个或两个在特定位置的数字。基本上我想匹配1-22之间的数字 我在bash中写道: cat chr[0-9][0-9]{0,}_from6_new_mono.txt >all_autosomes_from6_new_mono.txt 我得到这个错误: cat: chr[0-9][0-9]0_from6_new_mono.txt: No such file or directory 但是,文件名如下所示: chr22_from6_new_mono.txt 或 谁
cat chr[0-9][0-9]{0,}_from6_new_mono.txt >all_autosomes_from6_new_mono.txt
我得到这个错误:
cat: chr[0-9][0-9]0_from6_new_mono.txt: No such file or directory
但是,文件名如下所示:
chr22_from6_new_mono.txt
或
谁能告诉我哪里有问题吗?谢谢:)您确定正确使用支架扩展吗
查看了解更多信息是否确实正确使用了支架扩展
查看了解更多信息使用
bash
可以使用大括号展开来表示数字范围:
cat chr{1..22}_from_6_new_mono.txt >merged
使用
bash
可以使用大括号展开来表示数字范围:
cat chr{1..22}_from_6_new_mono.txt >merged