I am trying use a for loop for multiple files in my directory with a pipe command,but it does not seem to work. When am running the same command on a single file it seems to work. Where am I getting it wrong?
for x in *summary-FDR0.05 ; do sort -t $'\t' -k8,8rn $x | head -n 50000 | sortBed -i > sorted_top_50k_$x.bed; done
All my files end with summary-FDR0.05
. When I run
sort -t $'\t' -k8,8rn sample13-summary-FDR0.05 | head -n 50000 | sortBed -i > sorted_top_50k_S_13_O1_122*K27ac.bed
This seems to work well. May I know where I am getting it worng
Error:
sort: multi-character tab `$\\t'
Thanks