From 9aa98221c70b2c70997bfc5607b86b8602cfe73d Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sat, 31 May 2014 11:05:12 -0700 Subject: [PATCH 1/1] Specify time_fmt more succinctly --- gaps.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gaps.sh b/gaps.sh index cf95104..2d28af9 100755 --- a/gaps.sh +++ b/gaps.sh @@ -3,10 +3,7 @@ threshold=${1:-3600} LOGFILE="${2:-$HOME/keystroke-timestamps.log}" -awk -vthreshold="$threshold" ' - BEGIN { - time_fmt = "%F %T" - } +awk -vthreshold="$threshold" -vtime_fmt="%F %T" ' { if (prev && $1 - prev > threshold) { print(strftime(time_fmt, prev), "to", strftime(time_fmt, $1), "was", $1 - prev) -- 2.51.2