help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do arguments get expanded by right to left ?


From: Greg Wooledge
Subject: Re: do arguments get expanded by right to left ?
Date: Tue, 9 Mar 2021 15:57:57 -0500

On Tue, Mar 09, 2021 at 07:18:20PM +0100, Alex fxmbsw7 Ratchev wrote:
> as, i did an alias +time that does plustime+=( $EPOCHREALTIME ) ( with an
> ending space )
> and an alias time% to parse differency of two pairs of those times
> if i +time ; sleep 1 ; +time time% it displays it around 1s
> if i +time +time time% it displays me stuff like  5.29289e-05  and
> 4.60148e-05
> does it just mean the second +time is as is serial on the line processed
> gets expanded first ( the var inside the definition )
> or how should i decypher this ?
> i dunno to read those e values

He mentioned this in #bash.  I will attempt to translate.

What he did, apparently, was capture the value of $EPOCHREALTIME twice
in quick succession.  This gave him two floating-point values that were
very close together.

Then, he passed these two values to awk, in which he subtracted them from
each other, and printed the result, presumably using "print".

The result was a very small number, like 5.29289e-05.

He did not know what this number meant, because he had never seen this
notation before.  We tried our best to explain scientific notation, and
how powers of 10 work.

Beyond that, everything else in the question seems to be the result of
confusion.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]