On Thu, 01 Jun 2000, you wrote:
> Can someone please explain the concept behind ./ in executing a command.
> 
> If I am in the directory where the programme resides and type the programme
> name, I get a:
> "bash: programme name: command not found" message
> 
> If, from the same directory I type ./programme name everything works as
> advertised.
> 
> Thanks
> 
> Barry


Wherever you are, when you type a command name, the command interpreter (say
bash) looks for this command in a certain set of directories : the list of the
names of such directories  is associated to the (environment) variable PATH. If
none of these direcories contains the wanted command, the anwer of bash is
"command not found".

On the other side, when you type ./programme, you tell explicitly bash not to
look for programme in the PATH listed directories, but in the present working
directroy. 

The environment variable PATH recieves its value through a certain number of
initialising files : /etc/profile ; ~/.profile ; ~/bash_profile ; etc. 

On the other side, in the bash/sh/csh/etc. world, the character "." indicates
the directory in which you are, i.e. the present work directory.

Piero.


----------------------------------
        Dr Piero Caracciolo
        Ecole Normale Superieure

...humani nihil a me alienum puto.

Reply via email to