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

Re: var=$( typeset "$1" ) ... not within a function.




On 2022-10-20 17:54, Bart Schaefer wrote:
Yes, it's unfortunate that typeset (without options) was ever given
the function you describe as "passive reporter".  Worse that it's
synonym "declare" behaves the same.

Prowling around in the parameters there's lots of little mysteries,

 $ typeset -mp CDPATH
typeset -T CDPATH cdpath=(  )

... but the same command from within a script or function gives:

typeset -g -T CDPATH cdpath=(  )

... and if I scan the entire output of "$ typeset -p" and look for 'CDPATH' I get:

typeset -T CDPATH cdpath=(  )
typeset -aT CDPATH cdpath=(  )

... and from within a function the '-g' is added.

typeset -g -T CDPATH cdpath=(  )
typeset -g -aT CDPATH cdpath=(  )

... what's the truth of the matter with CDPATH?  And how in hell can there be two of them?

I get the feeling that this whole neck of the woods hasn't been given a housecleaning since ENIAC, it's just always been this way and probably has to stay this way due to the ancientness of the tradition.  Probably goes back to sh 0.1

... and while I'm whining I notice that 'set' never does anything like: "CDPATH cdpath", it puts them on separate lines.  Dunno, couldn't they have separate values?








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