🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.pc
Article #5453

Re: null as variable in batch file

#5453
From: Glen Story
Date: Wed, 12 Feb 1986 06:02
11 lines
983 bytes
In article <533@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=='':goto xx' as well as
>==' '

The following will solve your problem:

		if x%1 == x goto ...
Technical Details
Message-ID: <152@calma.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!linus!decvax!decwrl!sun!calma!story
References: <533@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 calma.UUCP
Path: arc1-ca.pugleaf.net!utzoo!linus!decvax!decwrl!sun!calma!story
From: story@calma.UUCP (Glen Story)
Newsgroups: net.micro.pc,net.micro
Subject: Re: null as variable in batch file
Message-ID: <152@calma.UUCP>
Date: Wed, 12-Feb-86 01:02:07 EST
Article-I.D.: calma.152
Posted: Wed Feb 12 01:02:07 1986
Date-Received: Thu, 13-Feb-86 17:19:15 EST
References: <533@whuts.UUCP>
Reply-To: story@calma.UUCP (Glenn Story)
Distribution: net
Organization: GE/Calma Co., R&D Systems Engineering, Milpitas, CA
Lines: 11