On Sat, Jun 15, 2024 at 06:45:21PM -0500, Tim Chase wrote:
> According to
> 
>   $ man [ | grep -A4 -e "-L.*f"
>      -L file
>         True if file exists and is a symbolic link.  This operator is for
>         compatibility purposes.  Do not rely on its existence; use -h
>         instead.
> 
> I was hunting through /etc/daily for something and see 1.5 (the 0.5
> being in a comment/template) instances of -L being used in there:
> 
>   $ grep -e '\[.*-L' /etc/*ly
>   /etc/daily:if [ -d /tmp -a ! -L /tmp ]; then
>   /etc/daily:#if [ -d /scratch -a ! -L /scratch ]; then
> 
> Seems like /etc/daily should use -h instead according to the
> man-pages.
> 
>   $ sed -i.bak '/\[.*-L/s/-L/-h/' /etc/daily
> 
> (found mostly because I didn't know what -L did, so I consulted the
> docs where they told me not to use it)
> 
> -tkc
> 

hi.

i think some digging is required...

- firstly, remember test exists as a shell builtin. i guess daily(8)
  will be running that, not /bin/test. the description in ksh(1) of -L
  has no such note about compatibility

- the netbsd test(1) page has the same compat as us.

- the freebsd page does not. at least one linux page i looked up online
  also did not.

so the question is probably when was the note added and is it still
justified. unfortunately i can;t currently access the cvs web page
online to try and work that out.

jmc

Reply via email to