This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How do you make a Bash script put output files in a specific directory

So I have a script for bwa to align a chloroplast to a genome I have.(of a plant) It's a bash script and I have "#SBATCH -o output_file" before the script. I want this output file to go into an already existing directory. How do I do this?

Thank you guys so much!!

genome

Without seeing your entire script following advice is necessarily generic. In your bwa command you could add full path before the output file name (e.g. bwa mem genome.fa reads.fastq | samtools sort -o /path_to_directory_you_want/alignment.bam). If you are using private variables then set out=/path_to_dir_you_want and then use ${out}/actual.bam in your command).

0 answers

No answers yet.

Log in to answer this question.