help-bash
[Top][All Lists]
Advanced

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

Re: Duration between two time stamps


From: Tapani Tarvainen
Subject: Re: Duration between two time stamps
Date: Fri, 20 Aug 2021 09:01:15 +0300

On Thu, Aug 19, 2021 at 11:14:25AM +0000, hancooper (hancooper@protonmail.com) 
wrote:

> Am not getting output from $EPOCHREALTIME
> 
>       A=$EPOCHREALTIME
...
>       B=$EPOCHREALTIME
>       DT=$( ${B}-${A} | bc )

Problem is that last line. Try instead

DT=$( echo $B-$A | bc )

or

DT=$( bc <<< $B-$A )

(You can use ${B}-${A} instead of $B-$A if you prefer, it makes
no difference in this case.)

-- 
Tapani Tarvainen



reply via email to

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