Re: REQUEST - bash floating point math support

2024-06-12 Thread Chet Ramey
On 6/5/24 2:59 AM, Léa Gris wrote: Le 05/06/2024 à 17:09, Koichi Murase écrivait : 2024年6月5日(水) 21:41 Zachary Santer : Bash could potentially detect floating point literals within arithmetic expansions and adjust the operations to use floating point math in that case. [...] ksh and zsh are al

Echoing commands

2024-06-12 Thread Angelo Borsotti
Hi, I am running bash 5.2.15(3)-release (x86_64-pc-cygwin) on cygwin running on Windows 10. Bash lacks a proper way of echoing commands, which is present in other shells, even in ones which are much less powerful, like, e.g. Windows CMD. This is not the same as debugging, for which set -x is devo

Re: Echoing commands

2024-06-12 Thread Greg Wooledge
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

Re: Echoing commands

2024-06-12 Thread alex xmb sw ratchev
~ $ 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

Re: Echoing commands

2024-06-12 Thread alex xmb sw ratchev
~ $ 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 \ %

Re: Echoing commands

2024-06-12 Thread alex xmb sw ratchev
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

Re: Echoing commands

2024-06-12 Thread alex xmb sw ratchev
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(

Re: REQUEST - bash floating point math support

2024-06-12 Thread Zachary Santer
On Thu, Jun 6, 2024 at 6:34 AM Léa Gris wrote: > > Le 06/06/2024 à 11:55, Koichi Murase écrivait : > > > Though, I see your point. It is inconvenient that we cannot pass the > > results of arithmetic evaluations to the `printf' builtin. This > > appears to be an issue of the printf builtin. I thin

Re: Echoing commands

2024-06-12 Thread Koichi Murase
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

Re: REQUEST - bash floating point math support

2024-06-12 Thread Saint Michael
I think that we should go ahead and do it. On Wed, Jun 12, 2024, 5:06 PM Zachary Santer wrote: > On Thu, Jun 6, 2024 at 6:34 AM Léa Gris wrote: > > > > Le 06/06/2024 à 11:55, Koichi Murase écrivait : > > > > > Though, I see your point. It is inconvenient that we cannot pass the > > > results of

Re: Echoing commands

2024-06-12 Thread Angelo Borsotti
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