Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Test if parameter is set
- X-seq: zsh-users 15966
- From: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
- To: Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx>
- Subject: Re: Test if parameter is set
- Date: Tue, 19 Apr 2011 18:22:48 +0100
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.fr; s=s1024; t=1303233770; bh=OIVKkiLh/TTtTitfbPiX0vAM7Sg4LzE9yRrJLN/GcUg=; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; b=jyxf3UGk49FT7wZrTNe55P/z+nzso1nmcUUvzym4/34O6EsbDufIiohv3bfoQk0CaJtCMTUBWy2m/HAx3Z1Ij7w1zC0ntEFuKARsnn7yG7dPQxHbeWa7MUqQZurBtDTGoQmwhSuHVAmKTDXvM2GmZBykob3zA4cARZCo5xzJarE=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=DKIM-Signature:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; b=C9ndSclFsIdrTWLRyCgMcjfHT59JKFAwhH6vQt7Tdc08zifU/6WoODX7/B5HKTWbT4GMqroN3WCXjbaee7X0Q4QPdL0WoivBLM9IIfHVzbSWuyGxUGNC6H6x7RH277sT+HFwURJ0vdHWtqUMSta52tahdxdbpe/U3D9/3QqRPao= ;
- In-reply-to: <iokedv$c96$1@dough.gmane.org>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-followup-to: Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx>, zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author