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

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

 



On 2019-12-21 12:45:43-0800, Carlo Arenas <carenas@xxxxxxxxx> wrote:
> On Sat, Dec 21, 2019 at 8:50 AM Doan Tran Cong Danh
> <congdanhqx@xxxxxxxxx> 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

It's seems like I've misread my manpages.
Somehow, I couldn't find the mention of `-L' when I tried it last
time.
Please ignore this patch.

> 
> > 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

-- 
Danh



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux