TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
It would help to list build.command here so we can see what is being done. – Sean Allred Jul 21 '13 at 17:30
It's not getting as far as running build.command so what's in it makes no difference, does it? Actually, though, that's given me an idea. – Jack Aidley Jul 21 '13 at 17:44
up vote 1 down vote accepted

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.

share|improve this answer
Note that if one were to say #!/bin/env python instead as the first line, you could write a python script to process (eg compile) your document. That first line is called a shebang, and it tells other programs what kind of script it is. If you're already running bash (via Terminal), then bash will just do what bash does. – Sean Allred Jul 21 '13 at 18:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.