Super User is a question and answer site for computer enthusiasts and power users. 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

crontab -l:

* * * * * /Users/michel/Desktop/

/usr/local/bin/growlnotify -t 'Fact' -m "$(/Users/michel/Desktop/ data.txt)" -n 'myApp'

it doesn't tell an error, but growlnotify's message is empty, so "$(/Users/michel/Desktop/ data.txt)" didn't work.

but if I execute /usr/local/bin/growlnotify -t 'Fact' -m "$(/Users/michel/Desktop/ data.txt)" -n 'myApp' from bash manually it works a s planned.

share|improve this question
up vote 1 down vote accepted

Shell scripts invoked from cron are non-login, non-interactive shells, which means they're invoked in a kind of drastically stripped-down environment, and they don't source any of the typical shell startup scripts (.profile, .bashrc, etc.).

I'm guessing that relies on something that's not available by default in this mode. Like something that's defined in the usual login- or interactive-shell startup files that didn't get sourced.

See bash's (excellent) man page about the different ways bash can get invoked, and which startup files it looks for in each case.

share|improve this answer
The environment variables are different, PATH or LD_LIBRARY_PATH usually get you. You don't have a terminal either (I had stuff that broke on stty commands) – Rich Homolka May 22 '13 at 17:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .