From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3170 invoked by alias); 15 Oct 2015 06:32:42 -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: 20758 Received: (qmail 11454 invoked from network); 15 Oct 2015 06:32:42 -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 Message-ID: In-Reply-To: References: Date: Wed, 14 Oct 2015 23:32:40 -0700 Subject: Re: Best Way to Test an Environment Variable From: czech@sonic.net To: zsh-users@zsh.org User-Agent: SquirrelMail/1.4.22 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Sonic-Auth: 0G5oYZOqCGds+oxeQm0zydWWvMVCVGObLnDJb31tPZ18rzgI6b2R71soy+luTKbFcr97HqhE/0ukUrjz3M+2mwyecJVNpJTk X-Sonic-CAuth: UmFuZG9tSVaTe26fFiJ8/V/6G3Rwt5gJWMZNX65Qkm8xmad2VOejfffvKmifWbxT+qcRBkvgHAeuQVrDnWhyPInG/LfOcI/b X-Sonic-ID: C;/rtriAZz5RGtOOK7sH9FTg== M;8NttiAZz5RGtOOK7sH9FTg== X-Sonic-Spam-Details: -1.5/5.0 by cerberusd 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). Thanks, Corwin > Hi - > > I've been using: > > if [ -z $ENV_VAR ]; then > > > fi > > To test environment variables. It seems to work. > > But I'm curious - is there a better way in zsh to test an environment > variable? > > Thanks, > > > > Corwin >