Yeah guys, my bad :-) Let's explain what the problem was, it's such a laugh I guess it happens to all of you who spent lot of time programming, it's was a stupid error which you don't notice cause you're stressed at the office if [ "$MAX_HOUR" != "$MIN_HOUR" ] then while [ $CURRENT_HOUR -lt $MIN_HOUR ] || [ $CURRENT_HOUR -gt $MAX_HOUR ] do CURRENT_HOUR=`date +"%H"` echo "Waiting to valid time ($MIN_HOUR - $MAX_HOUR, current $CURRENT_HOUR)" >> $LOGFILE.err sleep 300 done fi That was the script, well as you can see CURRENT_HOUR is being declared INSIDE of the while loop, so....it was impossible to run if I didn't declare it before the loop :-) Thanks! Manuel -- Manuel Arostegui Ramirez. Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.