test -nt and -ot ignore the subsecond part of file timestamps
Bug #1855325 reported by
Sam Kendall
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mksh |
Fix Released
|
Low
|
Thorsten Glaser |
Bug Description
Example on Linux (RHEL 8):
$ touch a; sleep 0.1; touch b
$ ls --full-time a b
-rw-r--r-- 1 kendall staff 0 2019-12-05 13:41:43.483652556 -0500 a
-rw-r--r-- 1 kendall staff 0 2019-12-05 13:41:43.585652744 -0500 b
$ if [ a -ot b ]; then print older; fi
$ if [[ a -ot b ]]; then print older; fi
$
The last two commands should have printed "older".
$ print $KSH_VERSION
@(#)MIRBSD KSH R56 2018/01/14
$ uname -sr
Linux 4.18.0-
R49 on Cygwin and R46 on RHEL 7 have the same behavior.
Changed in mksh: | |
status: | Confirmed → Fix Released |
To post a comment you must log in.
-nt and -ot are Korn extensions, so there's no POSIX standard behavior to conform to.
On RHEL 7 and 8, ksh93 and bash do *not* have the bug. On my old-ish version of Cygwin, bash *does* have the bug.