From owner-freebsd-questions Fri May 17 9:42:34 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mail.27in.tv (roc-24-169-195-157.rochester.rr.com [24.169.195.157]) by hub.freebsd.org (Postfix) with ESMTP id 22B0A37B40C for ; Fri, 17 May 2002 09:42:28 -0700 (PDT) Received: (from root@localhost) by mail.27in.tv (8.12.2/8.11.6) id g4HGfBmM020427; Fri, 17 May 2002 12:41:11 -0400 (EDT) (envelope-from cjm2@earthling.net) Received: from 27in.tv (localhost [127.0.0.1]) by mail.27in.tv (8.12.2/8.11.6av) with SMTP id g4HGex8G020416; Fri, 17 May 2002 12:41:08 -0400 (EDT) (envelope-from cjm2@earthling.net) Received: from 216.153.202.55 (SquirrelMail authenticated user cjm2) by www.27in.tv with HTTP; Fri, 17 May 2002 12:41:10 -0400 (EDT) Message-ID: <1818.216.153.202.55.1021653670.squirrel@www.27in.tv> Date: Fri, 17 May 2002 12:41:10 -0400 (EDT) Subject: Re: What's the 'X' means in the shell test: if [ 'X${SNAPDATE}' != 'X' ]; From: "C J Michaels" To: In-Reply-To: <001101c1fd4d$00255400$4e406fa6@mountain> References: <001101c1fd4d$00255400$4e406fa6@mountain> X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: X-Mailer: SquirrelMail (version 1.2.7 [CVS]) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by AMaViS perl-11 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG It's doesn't mean anything. It's a way of testing for a null value w/o actually have a null if your if statement. liuc said: > > TYPE="FreeBSD" > REVISION="3.3" > BRANCH="RELEASE" > RELEASE="${REVISION}-${BRANCH}" > SNAPDATE="" > if [ "X${SNAPDATE}" != "X" ]; then If $SNAPDATE isn't set, this will effectively be testing if [ "X" != "X" ]. I don't believe if [ "${SNAPDATE}" != "" ] works in all situations. > RELEASE="${RELEASE}-${SNAPDATE}" > fi > VERSION="${TYPE} ${RELEASE}" > > if [ "X${PARAMFILE}" != "X" ]; then > RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' > \ > ${PARAMFILE}) > else > RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' > \ > $(dirname $0)/../sys/param.h) > fi -- Chris "I'll defend to the death your right to say that, but I never said I'd listen to it!" -- Tom Galloway with apologies to Voltaire To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message