[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: running script files.



On Thu, 7 Feb 2036, A. M. Varon wrote:

> Hi to all,
> 
> It seems that shell scripts i have made in my debian distrib. doesn't run.
> you need to put ./ in front in order for it to execute.
> 
> i have chmod the script it to be executable, my bash shell is in
> /etc/shells, and my first line in my shell script is #!/bin/bash.
> 
> what seems to be the problem? lshell?
> 
> Thanks in advance,
> 
> andre

The problem isn't in your scripts at all.  It is in the path set up for 
your shell.  Once you log in, type the command ``set''.  This will list a 
number of lines of variables that are defined for your login shell.  One 
will look like,

path    (/home/sstanley/bin /usr/local/bin /usr/bin /bin /usr/bin/X11 
              /usr/sbin . /sbin)

or like

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11

depending on whether you use tcsh or bash for your login shell.  In any 
case, this is the list of directories that are searched when you type a 
command.  The thing to notice is that you need the ``.'' in the path for 
it to find commands in the current directory (as in the first example 
above).  Otherwise, you have to type ./Command_Name to specify explicitly 
where the command is.  

This can be set by editing the .tcshrc (if you use tcsh) or .bash_profile 
(for bash) files in your root directory to add ``.'' to your path.  There 
is likely a ``set path= ...)'' command already in this file.  Just edit 
it to add ``.''.  Once the file is changed, log out and then log back 
in.  Everything should work fine then....

If this is not relatively clear, send me email....

Scott

> 
> 


Reply to: