From bdf0b26e197fcdb7d33ee5ca5bb6920ce04ce5ea Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Fri, 8 Apr 2011 00:02:44 +0200 Subject: [PATCH] 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" --- scripts/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index c504684c..3261a800 100644 --- a/scripts/functions +++ b/scripts/functions @@ -250,7 +250,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