From owner-freebsd-questions Wed Oct 17 6:39:41 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.c.bus.net (65-85-139-3.client.dsl.net [65.85.139.3]) by hub.freebsd.org (Postfix) with ESMTP id 8965C37B403 for ; Wed, 17 Oct 2001 06:39:37 -0700 (PDT) Received: from ws100.c.bus.net (ws100.c.bus.net [192.168.1.10]) by mail.c.bus.net (Postfix) with ESMTP id 8D33F76308; Wed, 17 Oct 2001 09:43:30 -0400 (EDT) Received: (from cao@localhost) by ws100.c.bus.net (8.11.3/8.11.3) id f9HDdG240604; Wed, 17 Oct 2001 09:39:16 -0400 (EDT) (envelope-from cao) Date: Wed, 17 Oct 2001 09:39:16 -0400 From: "Chuck O'Donnell" To: Korcek Vladimir Cc: "'freebsd-questions@FreeBSD.ORG'" Subject: Re: Execute program? Message-ID: <20011017093916.B40473@bus.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ; from Vladimir.Korcek@icn.siemens.de on Wed, Oct 17, 2001 at 03:27:47PM +0200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Oct 17, 2001 at 03:27:47PM +0200, Korcek Vladimir wrote: > Hi Folks, > > I have a question about executing a programs. For example I've > currently installed Netscape. It's installed in directory > "/usr/local/netscape". I have to run it only from this directory and > with command "./netscape". I want to be able run it from anywhere > (from any directory) and lets say with command "netscape" without > "./". What should I do. Whitch file I have modify? What I have to > add and which file I have to add this to? If you install netscape from the ports tree, it will handle this for you, as well as adding a few other handy packages. But, to answer your question, you may just want to create a symolic link or a shell script in some directory in your path, such as /usr/local/bin. Of course, you'll need to be root of you are working in a system directory like /usr/local/bin. 1. Shell script method: Maybe something like "/usr/local/bin/netscape": #!/bin/sh exec /usr/local/netscape/path/to/netscape-binary "$@" Don't forget to ``chmod 755 /usr/local/bin/netscape'' 2. Symbolic link method: ln -s /usr/local/netscape/path/to/netscape-binary /usr/local/bin/netscape Good luck, Chuck To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message