[comp.os.msdos.apps] WHICH batch file for 4DOS

bob@omni.com (Bob Weissman) (04/05/91)

Someone was asking for useful 4DOS aliases.  This isn't an alias, it's
a batch file, but it's a small, fast implementation of the "which"
command.  I.e., given the name part of a file, it will tell you the
full pathname of the file which would be executed.

Share and enjoy.

------------------ Cut Here ---------------
@echo off
rem WHICH.BTM -- usage is WHICH name [name...]
setlocal
for %p in (%&) gosub OneProg
quit

:OneProg
iff isalias %p then
	alias %p | input %%f
	echo "%p" is an alias for "%f"
else
	set f=%@search[%p]
	iff "%f" == "" then
		echo "%p" not found
	else
		echo %f
	endiff
endiff
return
------------------ Cut Here ---------------

-- 
Bob Weissman
Internet:	bob@omni.com
UUCP:		...!{apple,decwrl,pyramid,sgi,uunet}!omni!bob