Sunday, September 19, 2010

Check a bash script without executing

This is really essential sometime, we want to check the syntax and validate our script rather then running it upfront.

Available Options:

Debugging Options set -o Option Command-line Option Action
noexec -n Don't run commands; check for syntax errors only
verbose -v Echo commands before running them
xtrace -x Echo commands after command-line processing


Example:

$bash -n myscript.sh
$/bin/sh -nv myscript.sh

Enjoy!!!
DEBU

No comments:

Post a Comment

AWS re:Invent summary 2017

As you might know, this year’s AWS re:Invent was held @ Las Vegas 11/27 – 12/1.   Below links could be a good start to explore all ...