On 2017-10-28 15:40, Chet Ramey wrote: > On 10/27/17 10:53 AM, Eduardo Bustamante wrote: > > On Fri, Oct 27, 2017 at 1:21 AM, Boruch Baum <boruch_b...@gmx.com> wrote: > >> In Debian, using Bash version 4.4, path level 12, I've set a DEBUG trap > >> in my .bashrc and tried running the following command, with the > >> following output resulting. The five lines between the command being run > >> by fc and that command's output, is the text of the DEBUG trap. > > > > Here's a short reproducer:
@Eduardo: thanks. > Bash enables the verbose option while running the commands `fc' specifies > for executiont, since the historical practice is to echo the commands before > they get executed. Bash doesn't turn off the verbose option while running > trap commands (though it could; ksh93 does), so the trap commands get > echoed as well. @Chet: Is there a way to optionally turn off the verbose option for traps when running 'fc'? Toggling the verbose option from the command line only makes things more verbose for me (it echoes $PROMPT_COMMAND). For me, the desirable behavior would be for the default to inherit the behavior from outside the 'fc' command, with the exception that the actual lines being executed by 'fc' be always echoed. -- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0