On Fri, 2021-11-12 at 19:48 +0100, Andreas Schwab wrote:
>       FILE1 -nt FILE2  True if file1 is newer than file2 (according to
>                        modification date).
> 
> Andreas.
> 

So now we have a relation for 'older than' and for 'newer than', but how about 
'oldest' (executable), and 'newest' (executable)?

I could only come up with this:

unset y; for x in $(find bin -mindepth 1 -name "*"); do if [[ ${x} -nt ${y} ]]; 
then y=${x}; fi; done; echo newest: ${y};
y="bin"; for x in $(find bin -mindepth 1 -name "*"); do if [[ ${x} -ot ${y} ]]; 
then y=${x}; fi; done; echo oldest: ${y};

As you can see, the way the commands are initialized is not identical, because:

'-nt' returns a true when 'if file1 exists and file2 does not'  (y in     
initialized by the first condition evaluated)
'-ot' returns a true when 'if file2 exists and file1 does not'  (y is not 
initialized by the first condition evaluated)

When you try to selectively link new executables, I think it is important that 
you do not only have relations for 'older than' and 'newer than', but also 
consistent (identically initializated)
relations for 'oldest' and 'newest'.

Mischa.



Reply via email to