Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ksh compatibility: initial value of $_



> 2023/04/05 10:03, Oliver Kiddle <opk@xxxxxxx> wrote:
> 
> "Jun. T" wrote:
>> diff --git a/configure.ac b/configure.ac
>> index e6ced85d9..d33ea6945 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -1,4 +1,4 @@
>> -dnl
>> +dnexe
> 
> Is that part of the patch intentional?

Oops, sorry.

>> +[for zsh_cv_proc_self_exe in /proc/self/exe /proc/curproc/exe \
>> +                             /proc/curproc/file /proc/self/path/a.out no; do
>> +   readlink $zsh_cv_proc_self_exe >/dev/null && break
> 
> Given that you're ignoring the output, test -L is likely more portable

Thanks. and:

> 2023/04/05 18:00、Oliver Kiddle <opk@xxxxxxx>のメール:
> 
> zeurkous@xxxxxxxxxxxxxxx wrote:
>> FWIW, OpenBSD test(1) says--
(snip)
>> Note that last part. Is "-L" actually more standard? (Even on other
>> *cough* Unices, me's always used "-h").
> 
> Any system I have access to appears to support both. The other BSD's
> also have the same recommendation and on that basis, you're probably
> right that we should use -h.

On OpenBSD and NetBSD, the manpage says -L is for compatibility and
-h is recommended.
But on FreeBSD, DragonFly and macOS -h is for compatibility and
-L is recommended.

The source code of test command for OpenBSD:
https://github.com/openbsd/src/blob/master/bin/test/test.c

line 113:	{"-h", FILSYM, UNOP},	/* for backwards compat */

So I guess the manpage for OpenBSD (and NetBSD) is wrong?



Messages sorted by: Reverse Date, Date, Thread, Author