I have a command I want to run on all of the files of a folder, and the command\'s syntax looks like this:
tophat -o
You can use:
tophat -o "${f/.fastq/.bam}" "$f"
Testing:
f='path/to/sample1.fastq' echo "${f/.fastq/.bam}" path/to/sample1.bam