🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.pc
Article #5457

Re: null as variable in batcg file h file

#5457
From: R.D.Eager
Date: Wed, 12 Feb 1986 09:16
22 lines
1142 bytes
In article <533@whuts.UUCP> 2212msr@whuts.UUCP 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
>==' '


I remember a way to do this from my version 6 days (ah, when life was simple..)

It works on MS-DOS 2.11 anyway!

     if %1x == x ......
-- 
           Bob Eager

           rde@ukc.UUCP
           rde@ukc
           ...!mcvax!ukc!rde

           Phone: +44 227 66822 ext 7589
Technical Details
Message-ID: <754@eagle.ukc.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!seismo!mcvax!ukc!rde
References: <533@whuts.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!seismo!mcvax!ukc!rde
From: rde@ukc.ac.uk (R.D.Eager)
Newsgroups: net.micro.pc,net.micro
Subject: Re: null as variable in batcg file      h file
Message-ID: <754@eagle.ukc.ac.uk>
Date: Wed, 12-Feb-86 04:16:43 EST
Article-I.D.: eagle.754
Posted: Wed Feb 12 04:16:43 1986
Date-Received: Fri, 14-Feb-86 06:24:02 EST
References: <533@whuts.UUCP>
Reply-To: rde@ukc.UUCP (R.D.Eager)
Distribution: net
Organization: U of Kent at Canterbury, Canterbury, UK
Lines: 22