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

Re: Problem with an exported array

    Hi Peter :)

 * Peter Stephenson <pws@xxxxxxx> dixit:
> > There are hacks which could allow us to represent arrays in it but not
> > in a way programs like man could be expected to understand.
> That's not entirely true.  A brief and thorougly unscientific
> investigation suggests man is doing popen() or something equivalent.
> That means that if you set
> typeset -ax PAGER
> and zsh exported PAGER as the string "/bin/view -", it would work
> because the shell used to invoked the pager would do the splitting.

    That's true (almost). In the interim I'm going to use two
variables or better I will use 'pager' instead of 'PAGER', and will
tie both values with typeset -T. That will solve my problems, won't
clutter the environment namespace and is quite easy to remember. It
will be like PATH/path, for example.

> It shouldn't be too hard to make arrays get exported joined with a
> space, or maybe even a configurable string (though the param structure
> isn't conveniently extensible at the moment).

    I think that the most used case will be joining with spaces,
maybe the colon (PATH and the like). Anyway, since the variable names
are case sensitive (what does SuSv3 says about case?) and can be tied
together, the uppercase variable can be used as scalar and the
lowercase one as an array, so it is not really needed to modify the
Zsh code in order to support this. Just a note in the manual will be
enough (methinks...). Automatically tieing PAGER and pager will be of
help, too, since is a quite common variable, but I'm not sure if it
normally has spaces in it, so I'm not sure if it worths the effort ;))

    Thanks for the answer :)))

    Raúl Núñez de Arenas Coronado

Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/

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