weird while shellscript problem-SOLVED

D. Hugh Redelmeier hugh at mimosa.com
Thu Jun 7 23:14:42 UTC 2007


| From: Manuel Arostegui Ramirez <manuel at todo-linux.com>

| 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 :-)

When I write a shell script, I almost always start it with
	set -u -e

The -u means: consider it an error to refer to an unset variable
The -e means: terminate on a command failing

This lets me catch my mistakes a lot earlier.




More information about the fedora-list mailing list