From 6e1e9b738b81729ea2f9b746a69981c3abc2543a Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Fri, 3 Dec 2021 00:41:51 +0100 Subject: [PATCH] sh.1: correct doc on format used by ${.sh.command} (re: a959a352) It actually uses the same format as xtrace, which is *not* always shellquoted and eval-safe. --- src/cmd/ksh93/sh.1 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/cmd/ksh93/sh.1 b/src/cmd/ksh93/sh.1 index 76ed98501..73f77fdc0 100644 --- a/src/cmd/ksh93/sh.1 +++ b/src/cmd/ksh93/sh.1 @@ -1573,8 +1573,11 @@ When processing a .B DEBUG trap, this variable contains the current command line that is about to run. -Each argument is shell-quoted as necessary -so that the value is safe for being evaluated by the shell. +The value is in the same format as the output generated by the +.B xtrace +option (minus the preceding +.B PS4 +prompt). .TP .B .sh.edchar This variable contains the value of the keyboard character @@ -7542,10 +7545,14 @@ then will be executed before each command. The variable .B .sh.command -will contain the shell-quoted arguments of the current command line +will contain the current command line when .I action\^ -is running. +is running, in the same format as the output generated by the +.B xtrace +option (minus the preceding +.B PS4 +prompt). If the exit status of the trap is .B 2 the command will not be executed.