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

Re: Checking if a variable is exported



On Fri, Oct 21, 2016 at 10:27 PM, Martijn Dekker <martijn@xxxxxxxx> wrote:
> Hi all,
>
> Does zsh have a straightforward way for a script to check if a variable
> is exported? The closest-to-straightforward way I know of is to parse
> the output of 'typeset -p varname', which is hairy because the output
> might include various options to the command.

${(t)param} will contain "export".

-- 
Mikael Magnusson



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