scripts/functions: fix date munging when ns are not available

On some systems (eg. *BSD and Darwin), date does not support nanoseconds
(%N) precision. Instead of printing '%N' in this case, it just prints 'N'.
Fix the sed expression to handle this case.
This commit is contained in:
Titus von Boxberg 2010-02-03 00:24:24 +01:00
parent e6f4c47c21
commit f65b10457b

View File

@ -192,7 +192,7 @@ CT_Which() {
# to the highest entire second
# Usage: CT_DoDate <fmt>
CT_DoDate() {
date "$1" |sed -r -e 's/%N$/000000000/;'
date "$1" |sed -r -e 's/N$/000000000/;'
}
CT_STEP_COUNT=1