I want to break my bed file into the chromosome-specific files containing the data of respective chromosome so I used the following command 

     for chr in {1..22}; do awk -v chr=$chr '$1 == chr' data.txt > data_chr$chr.txt; done

The issue is that the files created do not contain any information.

My bed file has six columns and is having the following format

    chr1	10094	10144	563_280_1408	1	+
    chr1	10095	10144	421_286_567	0	+
    chr1	10165	10215	382_570_1514	9	+
    chr1	10170	10196	664_789_434	1	+
    chr1	10171	10221	439_96_1067	10	+
    chr1	10174	10223	378_525_47	5	+
    chr1	10174	10224	94_430_1386	6	+
    chr1	10217	10279	4_218_1107	5	+
    chr1	10224	10267	138_1957_415	59	-
    chr1	10242	10272	638_1023_1664	4	+

Any suggestions will be highly appreciated

You need to prefix the `chr` variable with the string literal `chr`, as right now you are asking `awk` to match the first field on numbers (1 through 22) and not chromosome names (chr1 through chr22).

    $ for chr in {1..22}; do awk -v chr="chr${chr}" ...

But BEDOPS offers a much faster and simpler way of splitting BED files with [bedextract][1], which uses a binary search approach on sorted BED files to jump to the start of a chromosome:

    $ fn=intervals.bed
    $ for chr in `bedextract --list-chr ${fn}`; do bedextract ${chr} ${fn} > ${fn}.${chr}.bed; done

With `awk` or `grep`, you need to re-read through the file linearly on every chromosome, which wastes time, especially on very large, whole-genome scale BED files. Use BEDOPS if your time is valuable to you.

  [1]: http://bedops.readthedocs.io/en/latest/content/reference/set-operations/bedextract.html