bug-bash
[Top][All Lists]
Advanced

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

add warning to test(1), bash(1) man page to first test if file exists


From: Dan Jacobson
Subject: add warning to test(1), bash(1) man page to first test if file exists
Date: 23 Feb 2002 04:06:43 +0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Posted to gnu.bash.bug, gnu.utils.bug.

Gentlemen, in the "Beware" item on the test(1) man page, and on the
bash help output and bash man page, please mention:

        For the tests listed above that do not explicitly mention they
        check if "file exists", be sure to first check if the file
        indeed exists, else the results are unpredictable.

[I have posted in the bash group how test -nt, -ot give different
results with bash's test vs. GNU test in that case.]

Perhaps even put warnings next to the -ot and -nt items to better
check if the file exists first.

Even me, computer whiz black belt, almost lost it all when a non
existent file still had a date apparently---fine with me, but don't
you think at least adding the fine print I suggest above will at least
lighten our conscious about users who "fall for" never dreaming that a
file that didn't exists could be still older or younger than another
file, because they think like the way that they grew up in school and
do not have their minds set to the thinking of the C functions in the
source code or something.

True, the copyright we use says "not responsible for losses" etc. but
still, if you add the fine print I suggest, you will at least be able
to say "I warned you".  Currently the only thing one can say to the
user who has just wiped out something or launched something wrongly
due to this is "gee, didn't you notice that the "test" items
mention "exists" or not, to which he will say, "yeah, enough so that
one is lulled into thinking that they all do this check.  That one or
two don't mention it  --- well, one might think that the writer didn't
want to bore us on every line, so just didn't mention it..." etc. etc.
Anyway, "the fact merits explicit mention", OK?

Perhaps also include an example of -a being used to combine a -e and a -ot...
-- 
http://www.geocities.com/jidanni/ Taiwan(04)25854780



reply via email to

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