🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #975

Re: A batch programming contest for you

#975
From: Yossi Gil
Date: Tue, 18 Aug 1992 23:32
26 lines
1538 bytes
ts@uwasa.fi (Timo Salmi) writes:

>As you might know I have a large collection of batch files and
>tricks garbo.uwasa.fi:/pc/ts/tsbat36.zip. I am always looking for
>useful new information for it.

>I have a puzzle for you gentle fellow programmers who are interested
>in batch programming. The task is the following.  With the standard
>batch commands write a batch that returns the extension of the
>(file) name given to the batch as the parameter (%1). No external
>commands or programs are allowed to perform the task.

I am away from my DOS machine now, but I think that the above ideas
will work after some polishing. 

	erase echo.*
	copy %1 echo.*
	for %%f in (echo.*) do %%f > ext 

The extension of %1 should be in the file ext now.

--
Joseph (Yossi) Gil                 {alberta,uw-beaver,uunet}!ubc-cs!yogi
Dept. of Computer Science          yogi@cs.ubc.ca (cs.ubc.ca=137.82.8.5)
6356 Agricultural Road., Univ. of B.C.,             Tel: +1-604-822-8175
Vancouver, British Columbia, V6T 1Z2, Canada.       Fax: +1-604-822-5485
Technical Details
Message-ID: <1992Aug18.233207.1159@cs.ubc.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!gumby!destroyer!ubc-cs!yogi
References: <1992Aug18.052017.3758@uwasa.fi>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!gumby!destroyer!ubc-cs!yogi
From: yogi@cs.ubc.ca (Yossi Gil)
Subject: Re: A batch programming contest for you
Message-ID: <1992Aug18.233207.1159@cs.ubc.ca>
Sender: usenet@cs.ubc.ca (Usenet News)
Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
References: <1992Aug18.052017.3758@uwasa.fi>
Date: Tue, 18 Aug 92 23:32:07 GMT
Lines: 26