On Fri, February 18, 2005 3:08 pm, Nick Rout said: > to run a command it needs to be in your PATH. The current directory is > not in your path, > > So to run a program that is in your home directory you need to tell the > shell where it is. ./ is a shortcut to your current directory. You could > also have givenm the full path like: > > /home/woodsey/tmp/sbminst > > (assuming sbminst is in a directory called tmp in your home directory.) > > If you put the commend somewhere in your path like /bin, /usr/bin etc > you would not need to do this - but don't do that in this case as its > use is a little dangerous and probably a one off. > > To see what your path is : > > echo $PATH
... just to answer the obvious question 'why the !$!$% isn't the current directory in my path by default' it's so that, for example, if you have a local program called 'ls', just typing in ls will always execute the expected command ( which is usually in /bin ) unless you want it to be different. 'twas a jolly jape in the old days to link rm to ls. My how we laughed! To override this functionality, there are a number of files that are executed when you log in that can modify your environment. Most distributions use bash as the default shell ( having just spent an hour or so on FreeBSD and tcsh, you wouldn't believe how frustrating that change can be! ). Anyway, bash uses .bash_profile for this purpose. If you add the line PATH=:$PATH to this file, or, if there is a line that extends $PATH in any way, then add a : immediately after the =, then this modifies it so that it looks in your current directory first. Hope that makes sense... Steve > > > On Fri, 18 Feb 2005 15:03:30 +1300 > rob wrote: > >> Thanks Chris, >> That worked. So what exactly does the ./ do? >> Woodsey > > -- > Nick Rout > Barrister & Solicitor > Christchurch > <http://www.rout.co.nz> > <[EMAIL PROTECTED]> > > -- Artificial Intelligence is no match for natural stupidity.
