From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15027 invoked by alias); 15 Oct 2015 17:46:02 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20760 Received: (qmail 18048 invoked from network); 15 Oct 2015 17:46:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 15 Oct 2015 10:34:42 -0700 From: Corwin To: zsh-users@zsh.org Subject: Re: Best Way to Test an Environment Variable In-Reply-To: <20151015094616.GT3670@isis.sigpipe.cz> References: <20151015094616.GT3670@isis.sigpipe.cz> Message-ID: <8d5cf11ed768516e8ccc6671c2483d46@sonic.net> User-Agent: Roundcube Webmail/0.9.5 X-Sonic-Auth: SoDalsVUsEwClZvzZ4v8NsIsU708XZsYNBlGIltsTUhFjz4jHIV4zX9dN5LLeK1dzETIkx8BTGyorvP53X7SUJ1wVCPpa4K0 X-Sender: (czech@sonic.net) X-Sonic-CAuth: UmFuZG9tSVaImbsRD3q2ibmKI2QHBN8znM8C3z1skxT1dqGsv4H0IJrYwgUOnQMzg/zmnH64Q5JPgmNTaiEOr9x14vvo2/zk X-Sonic-ID: C;GACyBGNz5RGKpr0U9jFv0A== M;8FK0BGNz5RGKpr0U9jFv0A== X-Sonic-Spam-Details: -1.5/5.0 by cerberusd Hi Roman - Thanks for the pointer to zshexpn. I will refrain from replying to a different topic with a new topic. Regards, Corwin On 2015-10-15 02:46, Roman Neuhauser wrote: > # czech@sonic.net / 2015-10-14 23:32:40 -0700: >> I probably should have clarified - the objective of the test is to see >> if >> the environment variable is set or not. -z $ENV_VAR seems to return 1 >> if >> the environment variable is not set or is set to null (zero bytes). > > zshexpn(1): > > ${+name} > If name is the name of a set parameter `1' is substituted, > otherwise `0' is substituted. > > ps your first email is a reply to an email with a completely unrelated > topic. don't do that. > > 891 Oct 14 jagmeet bali ( 49) ZSH feature request if not > present > 892 Oct 14 ZyX ( 53) |-> > 893 Oct 14 Peter Stephenso ( 120) | `-> > 894 Oct 14 czech@sonic.net ( 60) `->Best Way to Test an > Environment Variable > 895 Oct 14 czech@sonic.net ( 73) `->