How to execute shell script from LaTeX?

Viewed 46848

I'm trying to do the following in LaTeX:

\documentclass{article}
\begin{document}
\execute{/usr/local/bin/my-shell-script.sh}
\end{document}

The idea is to execute /usr/local/bin/my-shell-script.sh at the moment of .tex document processing and inject its output into LaTeX stream. Is it possible at all?

PS. It's possible through the package I've made: iexec

7 Answers

This is how I do it with my own iexec package:

\documentclass{article}
\usepackage{iexec}
\begin{document}
\iexec{/usr/local/bin/my-shell-script.sh}
\end{document}

When the output is not required, I can do just this:

\iexec{/usr/local/bin/my-shell-script.sh > /dev/null}
Related