Hello,
I need to run a command for each of my 50 samples. My 50 commands look like as follows:
obiconvert --uppercase Sample1.fastq > Sample1_edit.fastq
.........
obiconvert --uppercase Sample50.fastq > Sample50_edit.fastq
Each command would take ~2 minutes. I do not want to copy and past 50 times. I copied all of the 50 commands and pasted all of them in the Mac terminal. After running, I found the size of output files for a few samples are zero bytes: the commands for those samples did not run properly. I re-run the commands for those samples one by one, and the output files are normal.
How to run multiple commands on Mac OSX? Is there a easy way to run the 50 commands?
Thanks!
the macOS (OS X) terminal uses the
bash
shell by default. As such, you can take advantage of shell scripting for these kinds of tasks. There are plenty of tutorials on how to do this, check out some of these. If you need ideas on how to set up scripts, you can look for examples on the internet.Thank you for the links.