git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] test: switch to POSIX compliance symlink check

From
Carlo Arenas <carenas@gmail.com>
Date
Dec 21, 2019, 20:45 UTC
Message-ID
<CAPUEsphavRpYeJGLY73rzy18VFvTUfhsb=y6pC53e8b9aEbfRw@mail.gmail.com>
In-Reply-To
<20191221164057.24616-1-congdanhqx@gmail.com>

On Sat, Dec 21, 2019 at 8:50 AM Doan Tran Cong Danh <congdanhqx@gmail.com> wrote:

>
> POSIX doesn't specify `-L' flag for test(1), POSIX specify `-h' for
> checking symlink instead.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
seems to indicate both are valid and equivalent
> While most shells and test(1) implementation provides both `-L' and
> `-h' for checking symlink,
> OpenBSD and NetBSD says we shouldn't rely on its existence. [1]
and macOS (from FreeBSD[1]) says the exact opposite :
     -h file     True if file exists and is a symbolic link.  This operator
                   is retained for compatibility with previous versions of
                   this program.  Do not rely on its existence; use -L
                   instead.

agree it would be a good idea to use only one for consistency though, but it might be in that case a good idea to add it as a "recommendation" by adding this rule in t/check-non-portable-shell.pl or something like that IMHO

Carlo
[1] https://www.freebsd.org/cgi/man.cgi?test
Previous: Doan Tran Cong DanhNext: Danh Doan
Message 2 of 3 in “test: switch to POSIX compliance symlink check”
  1. test: switch to POSIX compliance symlink checkDoan Tran Cong Danh, Dec 21, 2019
  2. Carlo ArenasDec 21, 2019
  3. Danh DoanDec 22, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.