SmtC: Show me the Code
Ole Peter Smith
Instituto de Matemática e Estatística
Universidade Federal de Goiás
http://www.olesmith.com.br

Commands
  • System*
Detetesto as vitimas
Quando elas respeitam os seus carrascos.
Jean Paul Sartre
< Formats | System | $\LaTeX$ >

Language System Command

  1. Bash:
    Shell Script Listing: pdflatex.sh.
    #!/bin/sh
    
    /data/phpexec/pdflatex -interaction nonstopmode -output-directory $1 $1/$2 > $1/latex.log  2>&1
    
    #/usr/bin/pdflatex  -output-directory $1 $1/$2 > $1/latex.log 2>&1
    
  2. Python:
    Python Listing: System.py.
        def System_Exec(self,commands,cd=None,echo=False):
            cwd=os.getcwd()
            if (cd!=None):
                os.chdir(cd)
    
            if (echo):
                print "Running command:"," ".join(commands)+":",
    
            try:
                output=os.system(" ".join(commands))
            except:
                output="Warning! Unable to execute system command: "+" ".join(commands)
    
            if (echo):
                print output
    
            if (cd!=None):
                os.chdir(cwd)
    
            return output
    
  3. PHP:
    PHP Listing: System.php.
        function System_Exec(self,commands,cd="",echo=False):
            cwd=getcwd()
            if (empty(cd)):
                chdir(cd)
    
            if (echo):
                print "Running command: ".join(" ",commands).":",
    
            try:
                output=system(" ".join(commands))
            except:
                output="Warning! Unable to execute system command: ".join(" ",commands)
    
            if (echo):
                print output
    
            if (empty(cd)):
                chdir(cwd)
    
            return output
    
< Formats | System | $\LaTeX$ >
Messages:
0 secs.