source | all docs for version 0.8.6 | all versions | oilshell.org
Warning: Work in progress! Leave feedback on Zulip or Github if you'd like this doc to be updated.
Oil extends shell's set -x
to give you more visibility into your program's
execution.
In shell, the $PS4
variable controls the prefix of each trace line. The
default value is '+ '
, which results in traces like:
+ echo 1
+ echo 2
In Oil, the default is
PS4='${X_indent}${X_punct}${X_pid} '
X_indent
is affected by proc invocations, source
, and eval
X_punct
is:
+
for a command (TODO: make this richer?)>
and <
for indentation changes -- synchronous|
and .
for process start and stop -- asynchronous, e.g. with
pipelines and &
.To see hierarchical traces, turn on xtrace_rich:
shopt -s xtrace_rich # part of the oil:basic option group
$PS4
@BASH_SOURCE
, @FUNCNAME
, $LINENO
@SOURCE_NAME
as alias?$SECONDS
for timingxtrace_rich
Output