Pages Menu
TwitterRss
Categories Menu

Posted on 3 Oct, 2010 in Commandes, Linux |

Debug d’un script bash

-n  Checks for syntax errors without executing the script (noexec).

-u Causes an error to be thrown whenever you try to access a variable that has
not been set (nounset).

-v Sends all lines to standard error (stderr) as they are read, even comments.

-x Turns on execution tracing (xtrace) which displays each command as it is
executed.

.

errexit (-e) Causes the script to exit whenever there is an error.
noclobber (-C) Prevents the overwriting of files when using redirection.
nounset (-u) Causes the shell to throw an error whenever an unset
variable is used.
pipefail Causes a pipeline to error out if any section has an error.