Date: Sun, 2 Apr 2000 22:03:59 +0100 From: Nik Clayton <nik@freebsd.org> To: mlduke <mlduke@concentric.net> Cc: freebsd-newbies@freebsd.org Subject: Re: Information Message-ID: <20000402220359.A14063@kilt.nothing-going-on.org> In-Reply-To: <Pine.BSF.4.10.10003291733240.1078-100000@mlduke.concentric.net>; from mlduke on Wed, Mar 29, 2000 at 05:48:45PM -0700 References: <Pine.BSF.4.10.10003291733240.1078-100000@mlduke.concentric.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Mar 29, 2000 at 05:48:45PM -0700, mlduke wrote: > Information I wish I'd known about 2 years ago. > > Say we've just installed a port, xboard for example, we feel like > getting trashed in a chess game. Successful install, no errors, > but in response to: > >xboard > we get: > Command not found. <snip> > Shows easily that the xboard binary is in: > /usr/local/bin > So we do: > /usr/local/bin/xboard > And the game is on. Check the value of your PATH environment variable, $ echo $PATH it should already contain "/usr/local/bin" in it somewhere. If it doesn't you should add that to your path. A line like the following setenv PATH /usr/local/bin:$PATH in your .cshrc (if you use csh, you'll need to adjust that if you use sh, or any other shell) should be sufficient. Of course, the question then is "If I've /usr/local/bin in my path, and xboard is in /usr/local/bin, why does 'xboard' print 'Command not found'?" This is a Unix question, not a FreeBSD question. In a nutshell, when your shell starts up it scans all the directories in the $PATH variable, and notes which commands are where in an internal list (called a 'hash'). Then, when you type in a command, the shell doesn't have to hunt through all the directories in the $PATH to see if the filename you've typed in is there (and cause lots of disk activity). Instead, the shell just looks in its internal list ("hash") to see if the command is listed in there. If it is, it tries to run it, if it isn't you get "Command not found", even if the command is there. The question, then, is "How do I get the shell to update it's list of commands?" For that, hunt in your shell's manual page for the word "hash". . . N -- Internet connection, $19.95 a month. Computer, $799.95. Modem, $149.95. Telephone line, $24.95 a month. Software, free. USENET transmission, hundreds if not thousands of dollars. Thinking before posting, priceless. Somethings in life you can't buy. For everything else, there's MasterCard. -- Graham Reed, in the Scary Devil Monastery To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000402220359.A14063>