[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash conditional expressions

From: Mischa Baars
Subject: bash conditional expressions
Date: Fri, 12 Nov 2021 10:36:01 +0100

Hi All,

All of my makefiles only compile source files and link object files that
are NEW, as in the modification timestamp is newer than OR EQUAL TO the
access timestamp, such that when I include a new source file into a project
or produce a new object file during compilation of the project, it does not
take more time than required.

I have two different versions of Fedora running here, Fedora 32 and Fedora

Using Fedora 32 (bash 5.0.17) this returns a true, while on Fedora 35 (bash
5.1.8) this returns a false:
touch test; if [[ -N test ]]; then echo true; else echo false; fi;

This means that newly created object files are no longer recognized by the
compile scripts as new object files and executables are no longer linked
against these new object files.

Could you please restore the Fedora 32 behaviour? Someone must have read
the bash manual a little too precise, because now the statement only
returns true when a 'touch -a test' is given and not when a 'touch -am
test' is given.

As I understand it, -N stands for NEW and therefore should return a true
when either a 'touch -a test' or a 'touch -am test' is given. In my
opinion it is the manual page that should have been updated, and not the
bash response to a -N conditional expression.

Looking forward to a fix!

Best regards,
Mischa Baars.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]