zsh-users
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane_chazelas@yahoo.fr>
To: Thorsten Kampe <thorsten@thorstenkampe.de>
Cc: zsh-users@zsh.org
Subject: Re: Test if parameter is set
Date: Tue, 19 Apr 2011 18:22:48 +0100	[thread overview]
Message-ID: <20110419172248.GA6867@yahoo.fr> (raw)
In-Reply-To: <iokedv$c96$1@dough.gmane.org>

2011-04-19 18:48:57 +0200, Thorsten Kampe:
> Hi,
> 
> how can I test if a parameter is set?
> 
> Like in...
> 
> if $VAR_IS_SET; then
>     print Variable is set
> else
>     print Variable is not set
> fi
[...]

if (($+VAR))

or portably:

if [ -n "${VAR+x}" ]

-- 
Stephane


  parent reply	other threads:[~2011-04-19 17:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-19 16:48 Thorsten Kampe
2011-04-19 17:19 ` Frank Terbeck
2011-04-19 17:22 ` Stephane Chazelas [this message]
2011-04-19 17:26 ` Peter Stephenson
2011-04-19 17:32   ` Peter Stephenson

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=20110419172248.GA6867@yahoo.fr \
    --to=stephane_chazelas@yahoo.fr \
    --cc=thorsten@thorstenkampe.de \
    --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).