echo
- : echo ¶
- : echo
on¶ - : echo
off¶ - : echo
on all¶ - : echo
off all¶ - : echo
function on¶ - : echo
function off¶ Turn echoing of commands on or off so that each command is shown as it runs.
The accepted forms are:
onEcho the commands in script files as they run.
offStop all command echoing.
on allEcho the commands in both script files and functions as they run.
off allStop all command echoing and discard any per-function selections.
function onEcho the commands of the named function when it runs.
function offStop echoing the commands of the named function.
Called with no argument,
echoflips the current state: if any echoing is active it is switched off, otherwise script echoing is switched on. The named-function forms accept the keyword and the function name in either order.Programming Note: echoing every command is a quick way to follow the flow of a small piece of code, but the volume of output rises fast. For harder problems the interactive debugger (
help debug) is usually more practical.