I am not sure what I am doing wrong here. It seems to work properly when I use command line.
My script is pretty simple
!/bin/bash
for file in '*.bed';do
echo $file
bedtools intersect -wa -wb -a /data2/E34_uniq.bed -b $file > $file.tsv;
done
The error I get is for all the files read from the directory -
*****ERROR: Unrecognized parameter: GSM2310918_methylcall.Sample_7273.mincov10.bed *****
*****ERROR: Unrecognized parameter: GSM2310919_methylcall.Sample_7301.mincov10.bed *****
*****ERROR: Unrecognized parameter: GSM2310920_methylcall.Sample_7308.mincov10.bed *****
It should have been as
#!/bin/bash
for file in *.bed; do
echo "$file"
bedtools intersect -wa -wb -a /data2/E34_uniq.bed -b "$file" > "${file}.tsv";
done
Notice a few things here,
#!/bin/bash