Path: utzoo!mnetor!uunet!mcvax!ukc!stl!stc!datlog!dlhpedg!cl From: cl@datlog.co.uk (Charles Lambert) Newsgroups: comp.unix.questions Subject: Tool Capsules (was: How does a program get its path name?) Message-ID: <463@dlhpedg.co.uk> Date: 11 Mar 88 17:10:24 GMT References: <11923@brl-adm.ARPA> <7304@brl-smoke.ARPA> <7102@agate.BERKELEY.EDU> <8722@sunybcs.UUCP> Sender: ls@dlhpedg.co.uk Reply-To: cl@datlog.co.uk (Charles Lambert) Organization: FSD@Data Logic Ltd, Queens House, Greenhill Way, Harrow, London. Lines: 18 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