Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 397 Bytes

debug_shell.md

File metadata and controls

23 lines (19 loc) · 397 Bytes
$> ( set -x; cmd1; cmd2 )
$> set -v
$> set -x
$> bash -vx ./script.sh

With var env _DEBUG="on"

DEBUG() {
 [ "$_DEBUG" == "on" ] && $@
}
$> DEBUG echo "File is $filename"
$> DEBUG set -x
$> Cmd1
$> Cmd2
$> DEBUG set +x

#!/bin/bash -xv

ShellCheck