From: Eric Cook <llua@gmx.com>
To: zsh-users@zsh.org
Subject: Re: Checking if a variable is exported
Date: Fri, 21 Oct 2016 17:00:29 -0400 [thread overview]
Message-ID: <046bbc64-036a-5fce-ccd7-633d1bad90c1@gmx.com> (raw)
In-Reply-To: <032fd4ec-89c1-9dae-a729-c440048ff3ec@inlv.org>
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 ...
next prev parent reply other threads:[~2016-10-21 21:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-21 20:27 Martijn Dekker
2016-10-21 21:00 ` Eric Cook [this message]
2016-10-21 21:06 ` Nikolay Aleksandrovich Pavlov (ZyX)
2016-10-22 5:57 ` Bart Schaefer
2016-10-21 21:12 ` Mikael Magnusson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=046bbc64-036a-5fce-ccd7-633d1bad90c1@gmx.com \
--to=llua@gmx.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).