Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 want to run commands like pdflatex and cp from an octave script. Is there a way to do that?

share|improve this question
up vote 8 down vote accepted

Use the function system(<command>) to call a shell command from Octave. Replace <command> with the command you want to execute. (Note that MATLAB allows a shell command to be executed by prefixing it with an exclamation mark !, but Octave does not support this syntax. See this Wikibooks page for more information.)

share|improve this answer

unix(command) is another way to go. If you'd like to get properties of files directories etc. Xoctave does it automatically.

share|improve this answer

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.