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

Re: environment stuff.





On 29 Nov 2014, at 11:21, Ray Andrews wrote:

On 11/29/2014 02:53 AM, Roman Neuhauser wrote:

typeset -p prints variables that are in scope, not just exported ones. i can nest several expansions and inspect the results as i add each layer.

Ah, so a sort of global variable viewer.

Curious. This addresses a question that I recently had.

I thought that `printenv` showed a list of all known variables and their values, but I recently realized that it was missing a lot of them.


Q » Is `typeset` what I should use for that? Or is there a better way?


For example, I have sometimes used `printenv > all-vars.txt` to get a 'snapshot' of current variables. Seems like `typeset > all-vars.txt` is much better. I just compared them and `typeset` shows 291 vs `printenv` showing 110.

TjL



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