[Top][All Lists]

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

Re: bash conditional expressions

From: Michael J. Baars
Subject: Re: bash conditional expressions
Date: Wed, 17 Nov 2021 11:16:37 +0100
User-agent: Evolution 3.36.5 (3.36.5-2.fc32)

On Mon, 2021-11-15 at 09:23 -0500, Chet Ramey wrote:
> On 11/12/21 4:36 AM, Mischa Baars wrote:
> > 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.
> Why do you think `touch -am', which sets the atime and mtime to the same
> value, should make -N true?

When -N stands for NEW, and touch (-am) gives you a new file, then -N should 
return true on a newly created file and the documentation is incomplete.

> If test -N is a strict test that mtime > atime, it is working correctly
> and you have managed to defeat it by setting atime == mtimne.

reply via email to

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