Skip to content

Latest commit

 

History

History

trace-using-set-x-then-set-x-without-printing

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Trace using set -x then set +x without printing

To help with debugging a script, you can use the "echo before execute" setting:

Turn on "echo before execute":

set -x

Turn off "echo before execute":

set +x

Turn off "echo before execute" without printing the line:

{ set +x; } 2>/dev/null

Example to turn on, then run some commands, then turn off:

set -x
command1
command2
command3
{ set +x; } 2>/dev/null