bug-bash
[Top][All Lists]
Advanced

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

Re: bash's test and GNU test give different results [if file not there]


From: Paul Jarc
Subject: Re: bash's test and GNU test give different results [if file not there]
Date: Thu, 21 Feb 2002 17:56:19 -0500
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/20.7 (i386-redhat-linux-gnu)

Dan Jacobson <address@hidden> wrote:
> OK, then what are we going to do about the different results test -ot, -nt
> give for bash's test vs. the GNU test?

We're going to write code that clearly expresses what we're checking
for, so that future maintainers (including ourselves, when we've
eventually forgotten writing the code in the first place) will
immediately understand the meaning of the code and so our code won't
fail on new, different implementations that don't match the behavior
we're accustomed to.
if ! test -e file1; then
  ...
elif ! test -e file2; then
 ...
elif test file1 -nt file2; then
  ...
else
  ...
fi

> I mean if I ask if I'm older than Bob Jenxz, I want you only to tell
> me yes if yes.

What if Bob wants it only to say no if no?


paul



reply via email to

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