Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

dash "-L" test for symbolic link may not be reliable #37

Open
TinCanTech opened this issue Nov 20, 2020 · 4 comments
Open

dash "-L" test for symbolic link may not be reliable #37

TinCanTech opened this issue Nov 20, 2020 · 4 comments

Comments

@TinCanTech
Copy link

Using dash I came across this and thought it may effect you.

-L 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 -h instead.
@spiralofhope
Copy link

spiralofhope commented Nov 30, 2020

-L and -h are both valid here:
https://linux.die.net/man/1/test

I can find your text in BSD, but it's the opposite!
https://www.freebsd.org/cgi/man.cgi?test

-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 in-
     stead.

Where can I find your reference in dash itself?

@TinCanTech
Copy link
Author

I was using Linux Mint 20 Cinnamon, man dash

Looks like this is a contentious bone ..

@spiralofhope
Copy link

I checked with Debian (Devuan) man dash and it agrees with your Mint 20, saying to use -h.

@TinCanTech
Copy link
Author

I find myself disinclined to agree with both Mint and Duvian.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants