我有bash脚本:
for x in *.bam; do bamToBed -i $x > ${x%.bam}.bed; done
但我不知道如何设置.bed文件的输出文件夹(从脚本输出)。
答案 0 :(得分:2)
## Define the folder you want to use for .bed files
outputFolder=/your/output/folder
## Make sure the folder is created
mkdir -p "$outputFolder"
for x in *.bam; do
## Redirect the output to a file in the above defined folder
bamToBed -i "$x" > "$outputFolder/${x%.bam}.bed"
done