GNU bug report logs - #60981
Bug in man page for the "test" command

Previous Next

Package: coreutils;

Reported by: kaulkwappe+0cvos0vxyd <at> prvy.eu

Date: Sat, 21 Jan 2023 08:50:02 UTC

Severity: normal

To reply to this bug, email your comments to 60981 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#60981; Package coreutils. (Sat, 21 Jan 2023 08:50:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to kaulkwappe+0cvos0vxyd <at> prvy.eu:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sat, 21 Jan 2023 08:50:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Kaulkwappe" <kaulkwappe <at> prvy.eu>
To: <bug-coreutils <at> gnu.org>
Subject: Bug in man page for the "test" command
Date: Sat, 21 Jan 2023 01:15:19 +0100
Dear colleagues,

this might have been reported before (or not), but there is a confusing description in the man page of the "test command:

###
-e FILE
  FILE exists

-L FILE
  FILE exists and is a symbolic link (same as -h)

###

The problem here is the situation of a broken symlink. When flag -e is used on a broken symbolic link, it fails. But when -L is used on a broken symlink, it returns true.

While this may be the expected behavior, it does not reflect what the documentation says. Because if -e fails on a broken symlink ("FILE exists") one would assume that the same of course is true for -L. The correct description for -L should be:

###
-e FILE
  FILE exists or is valid symbolic link

-L FILE
  FILE is a symbolic link, whether broken or not (same as -h)

###

Kind Regards,
Kaulkwappe





Information forwarded to bug-coreutils <at> gnu.org:
bug#60981; Package coreutils. (Sat, 21 Jan 2023 09:11:01 GMT) Full text and rfc822 format available.

Message #8 received at 60981 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: "Kaulkwappe" <kaulkwappe <at> prvy.eu>
Cc: 60981 <at> debbugs.gnu.org, kaulkwappe+0cvos0vxyd <at> prvy.eu
Subject: Re: bug#60981: Bug in man page for the "test" command
Date: Sat, 21 Jan 2023 10:10:29 +0100
The man page already addresses this:

       Except for -h and  -L,  all  FILE-related  tests  dereference  symbolic
       links.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




This bug report was last modified 2 years and 202 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.