Tool Capsules (was: How does a program get its path name?)

Charles Lambert cl at datlog.co.uk
Sat Mar 12 03:10:24 AEST 1988


There have been several occasions when I've wanted a program to know where
it was invoked from,  and never found a satisfactory way.  Two examples:

    1.  A user-interface tool that dispatches other tools.  For security,
	I'd like the interface tool to dispatch it's helpers from the
	same installation directory,  without having to hard-code the
	path into it.  That way,  I would have a "tool capsule" that can
	be installed anywhere without the risk of people putting Trojan
	Horses (tools with the same name that do something naughty) in the
	path.

    2.  Self-documenting shell scripts.  If a shell script new where it was,
	it could use its own commentary as online documentation.

Has anyone implemented successful schemes like this?

---------------
Charles Lambert



More information about the Comp.unix.questions mailing list