I'm having a strange behaviour with a shell script on Ubuntu 12.04.1 LTS.
My script is scheduled to be launched every hour (in crontab). It uses /bin/bash, but sometimes it switches to /bin/sh without any reason.
Here are some portions of the env command that I'm logging from within the script.
The correct one is:
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/jdk/jdk1.6.0_35/bin
The wrong one that sometimes occurs is:
SHELL=/bin/sh
PATH=/usr/bin:/bin
The problem is that I'm losing the PATH variable and I gets an error when I try to run a command.
Any hint? Thanks!
#!/bin/bash
?