To avoid intermediary files, you can chain the commands with pipes:
bedtools subtract -a A.bed -b B.bed \
| bedtools subtract -a stdin -b C.bed \
| bedtools subtract -a stdin -b D.bed > only_A.bed
1) I believe you meant
bedtools subtract -a temp2.bed –b D.bed > only_A.bed at you third command, correct?
2) be careful with hyphens (used to indicate command-line parameters) and paragraph marks. Your command-lines above correctly use hyphens for
-a, but incorrectly use paragraph dash for
edit: I don't know if
bedtools subtract -b accepts multiple files (I think it doesn't), but you can easily check for yourself: just try it and compare the results with the output of the multiple commands with intermediary files.