From owner-freebsd-questions Sun Apr 12 21:37:01 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA00802 for freebsd-questions-outgoing; Sun, 12 Apr 1998 21:37:01 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from euthyphro.uchicago.edu (euthyphro.uchicago.edu [128.135.21.31]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA00755 for ; Sun, 12 Apr 1998 21:36:54 -0700 (PDT) (envelope-from sfarrell@phaedrus.uchicago.edu) Received: from phaedrus.uchicago.edu (phaedrus [128.135.21.10]) by euthyphro.uchicago.edu (8.8.6/8.8.4) with ESMTP id XAA06116; Sun, 12 Apr 1998 23:36:38 -0500 (CDT) Received: (from sfarrell@localhost) by phaedrus.uchicago.edu (8.8.8/8.8.5) id XAA13508; Sun, 12 Apr 1998 23:36:31 -0500 (CDT) To: Dean Hollister Cc: FreeBSD Questions Subject: Re: bash: checking for empty string? References: From: sfarrell+lists@farrell.org Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII Date: 12 Apr 1998 23:36:31 -0500 In-Reply-To: Dean Hollister's message of "Mon, 13 Apr 1998 10:50:47 +0800 (WST)" Message-ID: <87k98ugwxc.fsf@phaedrus.uchicago.edu> Lines: 19 X-Mailer: Gnus v5.6.3/XEmacs 20.3 - "Vatican City" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dean Hollister writes: > If have a string $name. I need to check if this is blank, and if it > is, exit the script. Any ideas? man test(1) man [ so, for example if [ -z "$SOMEVAR" ]; then echo "SOMEVAR is undefined!" exit 1 fi -- Steve Farrell To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message