🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.pc
Article #5455

Re: null as variable in batcg file h file

#5455
From: Ed Nather
Date: Wed, 12 Feb 1986 18:20
17 lines
992 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
> ==' '

Try 

     if "%1" == ""

-- 
Ed Nather
Astronomy Dept, U of Texas @ Austin
{allegra,ihnp4}!{noao,ut-sally}!utastro!nather
nather@astro.UTEXAS.EDU
Technical Details
Message-ID: <362@utastro.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!gatech!ut-sally!utastro!nather
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!watmath!clyde!cbosgd!gatech!ut-sally!utastro!nather
From: nather@utastro.UUCP (Ed Nather)
Newsgroups: net.micro.pc,net.micro
Subject: Re: null as variable in batcg file      h file
Message-ID: <362@utastro.UUCP>
Date: Wed, 12-Feb-86 13:20:29 EST
Article-I.D.: utastro.362
Posted: Wed Feb 12 13:20:29 1986
Date-Received: Fri, 14-Feb-86 02:38:50 EST
References: <533@whuts.UUCP>
Distribution: net
Organization: U. Texas, Astronomy, Austin, TX
Lines: 17