Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Oct 2001 09:39:16 -0400
From:      "Chuck O'Donnell" <cao@bus.net>
To:        Korcek Vladimir <Vladimir.Korcek@icn.siemens.de>
Cc:        "'freebsd-questions@FreeBSD.ORG'" <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Execute program?
Message-ID:  <20011017093916.B40473@bus.net>
In-Reply-To: <E705EE249FE6D3119BB50008C791E2E5023CFFAD@MCHH264E>; from Vladimir.Korcek@icn.siemens.de on Wed, Oct 17, 2001 at 03:27:47PM %2B0200
References:  <E705EE249FE6D3119BB50008C791E2E5023CFFAD@MCHH264E>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011017093916.B40473>