On Wed, 23 Jan 2002, Steven C. Darnold wrote:
> Here is the challenge:
> ----------------------
> There is an executable file somewhere on your harddrive.
> It is in the path (assume there are several directories
> in that path). You need to write a script (batch file)
> that inputs the simple name of the executable and outputs
> the full path name.
>
> For example, let's say your DOS batch file is called
> findit.bat. You enter the following:
> ----------
> findit mem
> ----------
>
> and then your batch file prints this (and only this):
> --------------------------
> C:\WINDOWS\COMMAND\MEM.EXE
> --------------------------
Here's my solution: Put this file in a directory listed in the PATH on
the drive you are using.
"
@echo off
cd\
dir %1.*/s/p/b
"
and call it "FINDIT.BAT".
This should work for any version of DOS 3.30 or higher, and quite possibly
earlier.
> That's why we have restricted the competition to built-in
> commands only.
>
> > the question then becomes "Do we need to re-invent the
> > wheel, when we already have high quality tools?".
No. I'd normally just use the DIR command. ;-)
> This is just for fun. Our scripts have no practical utility
> (other than honing our minds).
>
> BTW, shell scripting is very suitable for survPCs. Even
> a humble 386sx16 with 4meg RAM can have a ton of fun doing
> bash scripting.
Right. And right again.
Boyd Ramsay
[EMAIL PROTECTED]
To unsubscribe from SURVPC send a message to [EMAIL PROTECTED] with
unsubscribe SURVPC in the body of the message.
Also, trim this footer from any quoted replies.
More info can be found at;
http://www.softcon.com/archives/SURVPC.html