[plug] script debugging
Anthony J. Breeds-Taurima
tony at cantech.net.au
Mon Aug 5 09:43:26 WST 2002
On 4 Aug 2002, Bill Kenworthy wrote:
> most shell specs take a verbose argument:
>
> "#!/bin/sh -x"
>
> chain subscripts/commands for simple error control:
>
> script1 && script2 runs script1 to completion before script2
Further to that:
----------
#!/bin/bash
set -x # Turn on debuging output
set -e # exit if _any_ command returns an error
...... rest of script here
----------
Obviously you should use the latter "-e" with caution as if can leave things
in a very messy state, as tempoary files etc etc wont get cleaned up.
Yours Tony
Jan 22-25 2003 Linux.Conf.AU http://linux.conf.au/
The Australian Linux Technical Conference!
More information about the plug
mailing list