Yes, you can do that, and it would be a good workaround *if*
$EPOCHREALTIME didn't already have 6 digits after the decimal point,
including any trailing zeros.
The point is that you don't have to, and I'm suggesting that the
documentation should make that clear so users can rely on it.
${EPOCHREA
On Jan 07 2019, Keith Thompson wrote:
> I suggest documenting this behavior. It would be nice to be able to
> depend on the exact format, for example that ${EPOCHREALTIME/*./}
> is always exactly 6 digits long.
ms=${EPOCHREALTIME/*./}00
ms=${ms:0:6}
Andreas.
--
Andreas Schwab, SUSE Labs,
Bash 5.0 adds $EPOCHSECONDS and $EPOCHREALTIME.
The latter expands, each time it's referenced, to the number of
seconds since the epoch with microsecond precision.
Experiment shows that the expansion always has exactly 6 digits after
the decimal point. For example, if you typed "echo $EPOCHREALT