112

Is it possible to make commands in crontab run with bash instead of sh? I know you can pass commands to bash with -c, but that's annoying and I never use sh anyway.

Fluffy
  • 2,077
  • don't really know what you're doing (not familiar with cron) but if you are running a script then adding a shebang to it should work, not sure if I am correct. – Alvin Wong Oct 11 '13 at 17:18

1 Answers1

160

You should be able to set the environment variable prior to the cron job running:

SHELL=/bin/bash
5 0 * * *       $HOME/bin/daily.job >> $HOME/tmp/out 2>&1
slm
  • 369,824