We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89b03df commit e1d46ebCopy full SHA for e1d46eb
1 file changed
tests/run.sh
@@ -415,8 +415,13 @@ make_xattrs() {
415
416
# Get the Unix epoch time in seconds
417
epoch_time() {
418
- # https://stackoverflow.com/a/12746260/502399
419
- awk 'BEGIN { srand(); print srand(); }'
+ if [ "${EPOCHSECONDS:-}" ]; then
+ # Added in bash 5
420
+ printf '%d' "$EPOCHSECONDS"
421
+ else
422
+ # https://stackoverflow.com/a/12746260/502399
423
+ awk 'BEGIN { srand(); print srand(); }'
424
+ fi
425
}
426
427
## Snapshot testing
0 commit comments