On Mon, May 25, 2020 at 03:35:57PM +0200, Quentin L'Hours wrote:
On 25/05/2020 15:11, Peng Yu wrote:
But if your point is that -et should not be added. Then, why having
-eq (as -le -ge implies -eq)?
Therefore, I think -eq should be added to bash to make it complete in
timestamp test.
It's probably because -eq is useful in many scenarios.
But on the other hand testing that two files have the exact same timestamp
seems very specific, whereas checking for instance if a file is outdated
compared to another one is very common.
Things that are only useful in very specific situations and that can be
achieved with simple workarounds (-e + -ot + -nt here) have very little
chance to be added (even if it seems trivial) for the usual reasons:
development time, maintenance, increased complexity etc.
I can't for the life of me think of an actual real world use case for
-et, honestly. There's the non-standard -ef which *does* have some use,
albeit uncommon ones (like testing whether a symblic link points to a
particular regular file, or if two symbolic links point to the same
file, etc.)