[solved] simple bash script not working: command not found

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hi,
I'm a new Hazel user from Italy.

I use my iPhone to write down some LaTeX *.tex files and I want to compile them (obtaining *.pdf) via hazel script watching a dropbox folder.

if I run
Code: Select all
pdflatex -interaction=nonstopmode NAMEFILE.tex

in terminal, it works fine producing the NAMEFILE.pdf

so I set up a Hazel rule on my dropbox folder to run this simple embedded script
Code: Select all
pdflatex -interaction=nonstopmode $1


but it returns a COMMAND NOT FOUND error in the console:
2012-01-31 12:14:53.614 (null)[0] [c]RoofCorr.tex: Rule compila .tex matched.
/var/folders/nq/rkl5334159q63d57tvxmw0nc0000gn/T/hazelfolderwatch-54231: line 1: pdflatex: command not found
2012-01-31 12:14:53.686 hazelfolderwatch[54231] [Error] Shell script failed: Error processing shell script on file /Users/arnaldo/Dropbox/ifttt/auto-LaTeX/[c]RoofCorr.tex.


I can't figure it out, is there something I am missing?

Thanks in advance for the support!
Last edited by lawful on Tue Jan 31, 2012 2:30 pm, edited 1 time in total.
lawful
 
Posts: 2
Joined: Tue Jan 31, 2012 8:04 am

You need to specify the full path of the pdflatex command. The script is being executed in a context where it doesn't have access to your .bashrc/.profile/.whatever. In general, it's always a good idea to use the full pathnames of any programs in your shell scripts.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:You need to specify the full path of the pdflatex command. The script is being executed in a context where it doesn't have access to your .bashrc/.profile/.whatever. In general, it's always a good idea to use the full pathnames of any programs in your shell scripts.


Thanks, it worked! :D
lawful
 
Posts: 2
Joined: Tue Jan 31, 2012 8:04 am


Return to Support