Thursday, February 5, 2009

Bash: Debug script

The possibility to find a problem in a bash script is to use the -x variable to bash.

What the -x variable means is quite simple, it tells the script to just echo every single line of code in the script into the standard output of the shell (generally your console). What you do is to change your normal start line of the script from this:

#!/bin/bash

Into the line below:

#!/bin/bash -x

Found on the web, Tnx

No comments:

Post a Comment