I am trying to run a command which is something like this
intersectBed -a yeast.v2.bed -b cov.txt -wa -wb | awk -v OFS="\t" '{print $7,$8,$9,$6,$11,$10}' > out.txt
out.txt looks like this
chrI 151006 151096 0
chrI 142253 142619 53
chrI 87387 87500 8
I am working on the cluster and when I qsub the above command(that is submitting to the cluster) I get the out.txt file like this
chrIt151006t151096t0
chrIt142253t142619t53
chrIt87387t87500t8
The command line I am using with qsub is this:
qsub -l h_vmem=4G -cwd -j y -b y -N test "intersectBed -a yeast.v2.bed -b cov.txt -wa -wb | awk -v OFS="\t" '{print \$7,\$8,\$9,\$6,\$11,\$10}' > out.txt"
As you can see I have to escape each column($) with back slash so that shell does not consider it as its on variable. But some how tab does not work. Can anyone tell me what is going on here. Of course I can use
sed 's/t/\t/g'
after the awk command but I need to understand what is going on here and why does it not work.
Thanks in advance
Asked by user3138373
(2589 rep)
Mar 15, 2017, 04:01 PM
Last activity: Mar 15, 2017, 04:30 PM
Last activity: Mar 15, 2017, 04:30 PM