Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Jan 1999 16:36:13 -0800
From:      Matthew Hunt <mph@pobox.com>
To:        Chris Browning <brownicm@netunlimited.net>
Cc:        questions@FreeBSD.ORG, Chris <chrismar@walnut.readington.com>
Subject:   Re: executable scripts
Message-ID:  <19990102163613.A28157@wopr.caltech.edu>
In-Reply-To: <XFMail.990102192630.brownicm@netunlimited.net>; from Chris Browning on Sat, Jan 02, 1999 at 07:26:30PM -0500
References:  <19990102144023.B18130@wopr.caltech.edu> <XFMail.990102192630.brownicm@netunlimited.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jan 02, 1999 at 07:26:30PM -0500, Chris Browning wrote:

> So to answer my own dumb question... I should put the script in /usr/bin or
> some other directory on the path? I don't really care what directory it's in,
> that was just the directory I happened to be working from. Maybe the AIX box had
> . in the path. Sounds like a bad idea to me.

A couple of possibilities:

a) It doesn't need to be in a directory on the $PATH; you can explicitly
   type the path, as in:
	./foo

b) If it's for your own personal use, I suggest making a ~/bin directory,
   and adding that to your $PATH.  Then you can put any of your personal
   scripts or programs there, and they won't bother anyone else.

c) If the script is useful for all of your users, put it in
   /usr/local/bin (and make sure that's on your $PATH).  Software that
   install usually should go in /usr/local.

d) Only put things in /usr/bin if you have a darned good reason.  It's
   there for stuff maintained by the FreeBSD developers, and should be
   approximately the same on everyone's FreeBSD system.  /usr/local
   is for stuff that you add.

If you read "man hier" you'll get a more thorough discussion of what
goes where.

If you're new to Unix, and setting up a FreeBSD system for your own
personal use, you may not see much difference between (b) and (c)
since you're the only user on your machine.  But it's a good habit
to get into to think about whether your changes are to suit yourself,
or (hypothetically) all of your users.  That can help you to decide
whether to put software and scripts in ~/bin or /usr/local/bin,
whether to change configuration files in /etc/foorc or ~/.foorc,
and so forth.  It's a good habit to get into early, even if it makes
little practical difference.

Matt

-- 
Matthew Hunt <mph@pobox.com> * Stay close to the Vorlon.
http://www.pobox.com/~mph/pgp.key for PGP public key 0x67203349.

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?19990102163613.A28157>