[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] How to tell if an environment variable exists or not
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] How to tell if an environment variable exists or not |
Date: |
Mon, 5 Mar 2012 14:57:44 -0500 |
User-agent: |
Mutt/1.4.2.3i |
On Mon, Mar 05, 2012 at 11:17:35AM -0600, Bill Gradwohl wrote:
> Assuming set -u, how does one test to see if an environment variable exists
> without creating it in the process?
if [[ ${foo+defined} ]]
http://mywiki.wooledge.org/BashFAQ/083