Date:Thu, 13 Jun 2024 11:51:13 -0400
From:"Dale R. Worley"
Message-ID: <87jzisx2mm@hobgoblin.ariadne.com>
| For instance, how should this be logged?
|
| $ { echo foo ; echo bar ; } >/dev/null
In the NetBSD shell:
[jacaranda]{2}$ { echo foo ; echo bar
Date:Wed, 12 Jun 2024 19:31:13 +0200
From:Angelo Borsotti
Message-ID:
| I would stress the importance of this: the purpose of scripts is
| to execute commands,
Yes.
| informing the caller of what they execute,
No. If a script wants to provide output like
On Thu, Jun 13, 2024 at 11:51:13AM -0400, Dale R. Worley wrote:
> For instance, how should this be logged?
>
> $ { echo foo ; echo bar ; } >/dev/null
> + echo foo
> + echo bar
I'm 99% sure I know what answer the OP of this thread will give:
"It should write '{ echo foo ; echo bar ; }
Angelo Borsotti writes:
> the solution to show commands with "set -x" has, however, a flow: it
> does not show properly commands that contain redirections. E.g.,
...
> cat f1.txt f1.txt > f1.tmp
But showing redirections properly is difficult, not just in the
implementation, but in what it *means*
On Thu, Jun 13, 2024 at 10:01:16AM +0200, Angelo Borsotti wrote:
> @echo-on
> cat f1.txt f1.txt > f1.tmp
> @echo-off
>
> I.e. the command is not entirely displayed.
Yeah. This is what I mentioned originally: set -x does not show
redirections. Ever. There is no workaround for this currently.
A
Dear all,
the solution to show commands with "set -x" has, however, a flow: it
does not show properly commands that contain redirections. E.g., let
tmp.sh be:
#!/bin/bash
shopt -s expand_aliases
alias @echo-on='set -x'
alias @echo-off='{ set +x; } 2>/dev/null'
PS4=
@echo-on
cat f1.txt f1.txt > f1
Dear all,
thank you very much for your quick replies. The solution:
alias @echo-on='set -x'
alias @echo-off='{ set +x; } 2>/dev/null'
PS4=
Solves the problem, and relieves from writing "echo COMMAND" before each
command that should be shown.
-Angelo Borsotti
On Wed, 12 Jun 2024 at
2024年6月13日(木) 5:20 Angelo Borsotti :
> This is not the same as debugging, for which set -x is devoted.
> "set -x" makes the ensuing commands be printed, but prefixed
> with "+ ", which makes the result look ugly,
PS4= (as Greg has replied)
> not to mention that
> the following "set +x" is echoed
args1() { printf %s\ "${@@K}" ; printf \\n ; } ; args1 echo foo ; args1
echo two three
On Wed, Jun 12, 2024, 10:58 PM alex xmb sw ratchev
wrote:
> there are two output lines , for the two cmds , sorry gmail problem
>
> On Wed, Jun 12, 2024, 10:57 PM alex xmb sw ratchev
> wrote:
>
>> ~ $ args1(
there are two output lines , for the two cmds , sorry gmail problem
On Wed, Jun 12, 2024, 10:57 PM alex xmb sw ratchev
wrote:
> ~ $ args1() { printf %s\ "${@@K}" ; printf \\n ; } ; args1 echo foo ;
> args1 echo two three 'echo' 'foo'
> 'echo' 'two' 'three'
> ~ $
>
> On Wed, Jun 12, 2024, 10:5
~ $ args1() { printf %s\ "${@@K}" ; printf \\n ; } ; args1 echo foo ;
args1 echo two three 'echo' 'foo'
'echo' 'two' 'three'
~ $
On Wed, Jun 12, 2024, 10:52 PM alex xmb sw ratchev
wrote:
> ~ $ logf=$HOME/alog1 ; run1() { printf '%(%F+%T%z)T %s' -1 "$1" >>"$logf"
> ; (( $# > 1 )) && printf \ %
~ $ logf=$HOME/alog1 ; run1() { printf '%(%F+%T%z)T %s' -1 "$1" >>"$logf" ;
(( $# > 1 )) && printf \ %s "${@:2}" >>"$logf" ; "$@" ; >>"$logf" printf
\\n ; } ; run1 echo foo ; cat "$logf"
foo
2024-06-12+22:51:31+0200 echo foo
~ $
On Wed, Jun 12, 2024, 10:26 PM Greg Wooledge wrote:
> On Wed, Jun 1
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
On 7/2/14, 2:22 AM, Filip Krska wrote:
> Of course, treat the patch rather as proof of concept, there may be side
> effect I'm not aware.
There's a more direct one-line patch I'm looking at.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita b
Hi Chet,
On 06/30/2014 08:55 PM, Chet Ramey wrote:
On 6/26/14, 4:56 AM, Ondrej Oprala wrote:
On 06/11/2014 07:26 PM, Chet Ramey wrote:
On 6/11/14, 6:35 AM, Ondrej Oprala wrote:
Hi,
bash-4.3 seems to act differently(better) in vi visual mode, than previous
bash-4 minors.
However, ksh gave a di
On 6/26/14, 4:56 AM, Ondrej Oprala wrote:
> On 06/11/2014 07:26 PM, Chet Ramey wrote:
>> On 6/11/14, 6:35 AM, Ondrej Oprala wrote:
>>> Hi,
>>> bash-4.3 seems to act differently(better) in vi visual mode, than previous
>>> bash-4 minors.
>>> However, ksh gave a different result all along.
>> This is
On 06/11/2014 07:26 PM, Chet Ramey wrote:
On 6/11/14, 6:35 AM, Ondrej Oprala wrote:
Hi,
bash-4.3 seems to act differently(better) in vi visual mode, than previous
bash-4 minors.
However, ksh gave a different result all along.
This isn't standardized, so I'm not worried about small differences b
On 6/11/14, 6:35 AM, Ondrej Oprala wrote:
> Hi,
> bash-4.3 seems to act differently(better) in vi visual mode, than previous
> bash-4 minors.
> However, ksh gave a different result all along.
This isn't standardized, so I'm not worried about small differences between
implementations in something t
18 matches
Mail list logo