Skip to content

echo

builtin · libnexusinterp/parse-tree/pt-eval-proprietary.cc

: 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:

on

Echo the commands in script files as they run.

off

Stop all command echoing.

on all

Echo the commands in both script files and functions as they run.

off all

Stop all command echoing and discard any per-function selections.

function on

Echo the commands of the named function when it runs.

function off

Stop echoing the commands of the named function.

Called with no argument, echo flips 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.