[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Echoing commands
From: |
Greg Wooledge |
Subject: |
Re: Echoing commands |
Date: |
Wed, 12 Jun 2024 16:25:46 -0400 |
On Wed, Jun 12, 2024 at 07:31:13PM +0200, Angelo Borsotti wrote:
> "set -x" makes the ensuing commands be printed, but prefixed
> with "+ ", which makes the result look ugly, not to mention that
> the following "set +x" is echoed too (there are hacks to suppress
> the "set +x" output, but they are just hacks).
If all you want is to remove the "+ ", you can simply set the PS4
variable to an empty string.
> set -o log
> cat tmp >tmp1 # or any other command
> set -o nolog
>
> producing the output on the console
>
> cat tmp >tmp1
If you want to retain redirections in the -x output, that's a whole
different issue. There is currently no way to do that. Chet would
have to implement something.