Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Checking if a variable is exported
On 10/21/2016 04:27 PM, Martijn Dekker 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.
>
> Thanks,
>
> - M.
>
if [[ ${(t)HOME} = *export* ]]; then ...
Messages sorted by:
Reverse Date,
Date,
Thread,
Author