help-bash
[Top][All Lists]
Advanced

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

Re: Searching inside files in a script


From: Tapani Tarvainen
Subject: Re: Searching inside files in a script
Date: Tue, 12 Oct 2021 23:06:43 +0300

On Tue, Oct 12, 2021 at 02:57:01PM -0500, Dennis Williamson 
(dennistwilliamson@gmail.com) wrote:

> > >    tim=${EPOCHREALTIME//[![:digit:]]/.}

> > Note, I deliberately set LC_NUMERIC that way to get a comma as the
> > decimal point, I presume that's the reason you're trying to do that
> > //[![:digit:]]/. thing.

> Or to do integer math in Bash instead of float math in bc or something.

In that case the decimal point should be removed, not replaced
with a period. That is,

tim=${EPOCHREALTIME//[![:digit:]]/}

or, as there're never multiple decimal points,

tim=${EPOCHREALTIME/[![:digit:]]}

or is there a locale where there could be thousands separators or
something like that in $EPOCHREALTIME?

-- 
Tapani Tarvainen



reply via email to

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