From 6e760223a4b413b23afaf03eeae78b0a1f021b93 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Fri, 8 Apr 2011 00:02:44 +0200 Subject: functions: fix date calculations In case date(1) does not support nanosecond resolution, it does not interpret '%N', and leave it as-is. So we have to remove it. Note that some versions replaces '%N' with 'N', so we have to take this into account as well. Reported-by: Kyle Grieb Signed-off-by: "Yann E. MORIN" (transplanted from bb6e2df2427f3db871721c96ca3226cfa24204bc) diff --git a/scripts/functions b/scripts/functions index 321ad12..2764b7c 100644 --- a/scripts/functions +++ b/scripts/functions @@ -235,7 +235,7 @@ CT_Which() { # to the highest entire second # Usage: CT_DoDate CT_DoDate() { - date "$1" |sed -r -e 's/N$/000000000/;' + date "$1" |sed -r -e 's/%?N$/000000000/;' } CT_STEP_COUNT=1 -- cgit v0.10.2-6-g49f6