= xonsh cheatsheet $PROMPT prompt spec $X value of variable X ${X} let Y be value of X, value of variable Y will be returned ${'HO' + 'ME'} get ENV HOME ${...} is ENV dict $PATH.append(x) append x to $PATH $(CMD…) run CMD in subprocess. stdout & err captured. return stdout !(CMD…) run CMD in subprocess. stdout & err captured. return xonsh.__amalgam__.CommandPipeline .stdout.getvalue() binary stdout .out UTF-8 stdout .stderr.getvalue() binary stderr .out UTF-8 stderr .returncode exit code .starttime start timestamp as UNIX epoch .endtime end timestamp as UNIX epoch $[CMD…] run CMD in subprocess. stdout & err to terminal. return None ![CMD…] run CMD in subprocess. stdout & err to terminal. return xonsh.__amalgam__.CommandPipeline @(CODE…) evaluate python CODE in shell context (return list to space-join them for proc call) @$(CMD) @([i.strip() for i in $(cmd).split()]), i.e. execute CMD and whitespace-split elements to create a list CMD1 and CMD2 run CMD2 only if CMD1.returncode==0 CMD1 or CMD2 run CMD2 only if CMD1.returncode!=0 `REGEX` regex matching files; returns list of strings g`GLOB` globbing pattern matching files; returns list of strings g`PATTERN` regex or globbing pattern matching Path; returns list of Paths IDENTIFIER? help(IDENTIFIER) CMD out> FILE redirect stdout of CMD to FILE CMD err> FILE redirect stderr of CMD to FILE CMD all> FILE redirect stdout & stderr of CMD to FILE CMD < FILE read stdin of CMD from FILE CMD; ; fg suspend exec of CMD; contiue with fg jobs list running jobs $RAISE_SUBPROC_ERROR = True “set -e” equivalent $EXPAND_ENV_VARS = False disable ENV replacement in CMDs $XONSH_TRACE_SUBPROC = True subprocess debugging with ${...}.swap(SOMEVAR='foo'): context manager to set ENV var temporarily