home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / msdos / programm / 8608 < prev    next >
Encoding:
Text File  |  1992-08-18  |  1.5 KB  |  38 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!gumby!destroyer!ubc-cs!yogi
  3. From: yogi@cs.ubc.ca (Yossi Gil)
  4. Subject: Re: A batch programming contest for you
  5. Message-ID: <1992Aug18.233207.1159@cs.ubc.ca>
  6. Sender: usenet@cs.ubc.ca (Usenet News)
  7. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  8. References: <1992Aug18.052017.3758@uwasa.fi>
  9. Date: Tue, 18 Aug 92 23:32:07 GMT
  10. Lines: 26
  11.  
  12. ts@uwasa.fi (Timo Salmi) writes:
  13.  
  14. >As you might know I have a large collection of batch files and
  15. >tricks garbo.uwasa.fi:/pc/ts/tsbat36.zip. I am always looking for
  16. >useful new information for it.
  17.  
  18. >I have a puzzle for you gentle fellow programmers who are interested
  19. >in batch programming. The task is the following.  With the standard
  20. >batch commands write a batch that returns the extension of the
  21. >(file) name given to the batch as the parameter (%1). No external
  22. >commands or programs are allowed to perform the task.
  23.  
  24. I am away from my DOS machine now, but I think that the above ideas
  25. will work after some polishing. 
  26.  
  27.     erase echo.*
  28.     copy %1 echo.*
  29.     for %%f in (echo.*) do %%f > ext 
  30.  
  31. The extension of %1 should be in the file ext now.
  32.  
  33. --
  34. Joseph (Yossi) Gil                 {alberta,uw-beaver,uunet}!ubc-cs!yogi
  35. Dept. of Computer Science          yogi@cs.ubc.ca (cs.ubc.ca=137.82.8.5)
  36. 6356 Agricultural Road., Univ. of B.C.,             Tel: +1-604-822-8175
  37. Vancouver, British Columbia, V6T 1Z2, Canada.       Fax: +1-604-822-5485
  38.