How to Debug a Shell Script ?? We can debug shell script by using “set -xv” command inside shell script or using -xv on command line while executing script. Debug Shell Script by adding Command : $ cat checkdebug.sh #!/bin/bash set -xv #