diff options
Diffstat (limited to 'tests/run.sh')
-rw-r--r-- | tests/run.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/run.sh b/tests/run.sh index 164790e..e3a4e3f 100644 --- a/tests/run.sh +++ b/tests/run.sh @@ -415,8 +415,13 @@ make_xattrs() { # Get the Unix epoch time in seconds epoch_time() { - # https://stackoverflow.com/a/12746260/502399 - awk 'BEGIN { srand(); print srand(); }' + if [ "${EPOCHSECONDS:-}" ]; then + # Added in bash 5 + printf '%d' "$EPOCHSECONDS" + else + # https://stackoverflow.com/a/12746260/502399 + awk 'BEGIN { srand(); print srand(); }' + fi } ## Snapshot testing |