0

I want to merge all files, which have one or two digits at certain position. Basically I want to match numbers from 1-22.

I write in bash:

cat chr[0-9][0-9]{0,}_from6_new_mono.txt >all_autosomes_from6_new_mono.txt

I get this error:

cat: chr[0-9][0-9]0_from6_new_mono.txt: No such file or directory

However file names look like this:

chr22_from6_new_mono.txt

or

chr1_from6_new_mono.txt

Could somebody pls advice me where could be problem? Thanks:)

Perlnika
  • 4,796
  • 8
  • 36
  • 47

2 Answers2

2

With bash you can use curly brace expansion to denote a number range:

cat chr{1..22}_from_6_new_mono.txt >merged
knittl
  • 246,190
  • 53
  • 318
  • 364
1

are you sure, you use the brace-expansion correctly?

look at http://www.gnu.org/software/bash/manual/bashref.html#Brace-Expansion for more informations

Hachi
  • 3,237
  • 1
  • 21
  • 29