[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ¿Qué hace "set -e"?



El jue, 31-05-2007 a las 14:50 +0200, Iñaki Baz Castillo escribió:
> Hola, veo en muchos scripts de inicio que se ejecuta un "set -e" antes
> del "case". No encuentro info sobre dicho comando "set", ¿qué hace?
> 
> Gracias.
> 
> 


Sale de la ejecución del script tan pronto se detecte como uno de los
comandos o funciones devuelve un error:

man bash

 -e      Exit immediately if a simple command (see SHELL GRAMMAR above)
exits with a non-zero  status. The shell  does  not exit if the command
that fails is part of the command list immediately following a while or
until keyword, part of the test in an if statement, part of a && or ││
list,  or  if  the command’s  return  value  is  being  inverted via !.
A trap on ERR, if set, is executed before the shell exits.

Saludos

-- 
http://soleup.eup.uva.es/mariodebian

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente


Reply to: