Label: bash shell span logs echo date blog uname contains

1.First line plus -xv

#!/bin/bash –xv

 

2. 

 bash -x  shellName

 

3.If you want to debug just a few lines of scripts, you can use set-x and set + X to include the parts you want to debug:

For example:

#!/bin/bash
echo "Hostname: $(hostname)"
set -x
echo "Date: $(date)"
set +x
echo "Kernel: $(uname -mrs)"

 

shell Script debugging

Label: bash shell span logs echo date blog uname contains

Original address: http://www.cnblogs.com/chenhuan001/p/6980152.html

Similar Posts:

Link of this Article: Shell script debugging

Leave a Reply

Your email address will not be published. Required fields are marked *