🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.pc
Article #5684

Re: null as variable in batch file

#5684
From: Walter Bright
Date: Fri, 14 Feb 1986 18:13
14 lines
1146 bytes
In article <534@whuts.UUCP> 2212msr@whuts.UUCP (ROBIN) writes:
>Does anyone know how to detect a null as variable input in a batch file?
>Specifically:
>
>foo %1   --how do I detect case where %1 is omitted, thus avoiding
>	   an error?  I've tried: 
>                       if %1==''
>                       if %1==' '
>                       if %1==<CTRL @>
>           all to no avail.  Any help or pointers would be appreciated.

Try this:

	if %1a == a
Technical Details
Message-ID: <912@dataioDataio.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!tektronix!uw-beaver!uw-june!entropy!dataio!bright
References: <534@whuts.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site dataioDataio.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!tektronix!uw-beaver!uw-june!entropy!dataio!bright
From: bright@dataioDataio.UUCP (Walter Bright)
Newsgroups: net.micro.pc
Subject: Re: null as variable in batch file
Message-ID: <912@dataioDataio.UUCP>
Date: Fri, 14-Feb-86 13:13:36 EST
Article-I.D.: dataioDa.912
Posted: Fri Feb 14 13:13:36 1986
Date-Received: Mon, 17-Feb-86 05:57:07 EST
References: <534@whuts.UUCP>
Reply-To: bright@dataio.UUCP (Walter Bright
Distribution: net
Organization: Data I/O Corp., Redmond WA
Lines: 14