Make 'set -x' print commands.

* gash/shell.scm (sh:exec-let): Respect the 'xtrace' option.
This commit is contained in:
Jan Nieuwenhuizen 2018-12-31 17:12:13 +01:00 committed by Timothy Sample
parent 05f3880419
commit 9f57723fb6
1 changed files with 6 additions and 0 deletions

View File

@ -99,6 +99,12 @@ it cannot be found, return @code{#f}."
(define (sh:exec-let bindings name . args)
"Find and execute @var{name} with arguments @var{args} and extra
environment variable bindings @var{bindings}."
(when (getopt 'xtrace)
(format (current-error-port) "+~a\n"
(string-join (cons name
(map (lambda (x)
(if (string-null? x) "''"
x)) args)))))
(if (slashless? name)
(or (and=> (search-special-built-ins name)
(lambda (proc)