[Tex/LaTex] TexStudio gives ‘Could not start command’ with the custom build script

compilingerrorstexstudio

I have a custom build script build.command that runs through the build steps necessary to convert my LaTex scripts into a .pdf (e.g. makeglossaries and so on). The script works fine. However when I try and get it to run in TexStudio it complains, saying: Error: Could not start the command: /Users/jackaidley/Documents/report/build.command "report". However, if I copy and paste from that to the Terminal and run the command then it works fine so I don't understand what the problem could be?

I have set it to run by modifying the pdfLaTex run command to ?a)build.command %.

This on Mac OS X 10.8.4 with TexStudio 2.4.

Best Answer

The reason it wasn't working was that the build.command file didn't contain the first line #!/bin/bash. I'm not sure why it would work from the command line but via TexStudio but there you go.

Thanks to Sean Allred's comment for giving me the inspiration to try this.