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

Re: [PATCH] sh/ksh init: don't initialise lowercase parameters



Martijn Dekker wrote on Tue, Jan 28, 2020 at 16:19:41 +0100:
> In POSIX sh and in ksh, it's the convention that lowercase variable names
> are reserved for scripts, and uppercase names may be used by the shell or
> system.

I wouldn't mind having a test for this.  How about:

diff --git a/Test/B07emulate.ztst b/Test/B07emulate.ztst
index 7b1592fa9..28a381aab 100644
--- a/Test/B07emulate.ztst
+++ b/Test/B07emulate.ztst
@@ -276,3 +276,7 @@ F:Some reserved tokens are handled in alias expansion
 0:--emulate followed by other options
 >yes
 >no
+
+ $ZTST_testdir/../Src/zsh --emulate sh -fc 'typeset -pm "[a-z]*"'
+ $ZTST_testdir/../Src/zsh --emulate ksh -fc 'typeset -pm "[a-z]*"'
+0:sh/ksh emulations don't define lowercase variables

> +++ b/Doc/Zsh/compat.yo
> @@ -1173,8 +1173,8 @@ tt(histchars) to characters with a locale-dependent meaning will be
>  vindex(HISTCHARS)
> -item(tt(HISTCHARS) <S> <Z>)(
> -Same as tt(histchars).  (Deprecated.)
> +item(tt(HISTCHARS) <S>)(
> +Same as tt(histchars).
>  )

Why de-deprecate the uppercase spelling?  Do ksh or POSIX sh define "HISTCHARS"
in uppercase?  The lowercase spelling does seem to be a csh/tcsh thing.

Cheers,

Daniel



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