weird while shellscript problem-SOLVED

Manuel Arostegui Ramirez manuel at todo-linux.com
Fri Jun 8 06:42:14 UTC 2007


El Viernes, 8 de Junio de 2007 01:14, D. Hugh Redelmeier escribió:
> | 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.

Oh, Hugh, that's a great trick, thanks, I'll use it from now on
Have a good weekend
-M

-- 
Manuel Arostegui Ramirez.

Electronic Mail is not secure, may not be read every day, and should not
be used for urgent or sensitive issues.




More information about the fedora-list mailing list