Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jun 282014
 

Writing more robust shell script

Answer:

You should always start your bash shell script with the line set -eu

The meaning is:

  1. -e: cause the script to exit if an error
  2. -u: cause the script to exit if any variable is not set

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>