home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.msdos.programmer
- Path: sparky!uunet!drivax!liberato
- From: liberato@dri.com (Jimmy Liberato)
- Subject: Re: Another MsDos batch programming challenge
- Message-ID: <FRDQB0DG@dri.com>
- Reply-To: liberato@dri.com (Jimmy Liberato)
- Organization: Novell/Desktop Systems Group, Monterey Development Center
- References: <1992Aug29.063552.26386@uwasa.fi> <1992Aug29.152816.14977@cs.ubc.ca>
- Date: Sun, 13 Sep 92 04:17:03 GMT
- Lines: 30
-
- yogi@cs.ubc.ca (Yossi Gil) writes:
-
- >ts@uwasa.fi (Timo Salmi) writes:
- >
- >>...
- >>Write a batch that returns (sets an environment
- >>variable) to give the current directory.
- >
- >Following my tradition of suggesting dirty tricks here is my 3
- >lines version:
- >
- >cd >> %0
- >echo echo %%set%% >> %0
- >set set=^Z
- >
- >(The above should be invoked with the .BAT extension. It should
- >be quite easy to remove this restriction)
-
- This is very clever but doesn't its self-modifying behavior cause it
- to fail after one use? (The location of the end-of-file marker, ^Z,
- is important in your scenario.) And wouldn't CD be a better environment
- variable name than SET? In any case, I can't come up with something
- that works even once! :-(
-
- --
- Jimmy Liberato liberato@dri.com
- ...uunet!drivax!liberato
-
-
-
-