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

Re: Test if parameter is set



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