In <[EMAIL PROTECTED]>, on 10/21/98 
   at 11:09 PM, [EMAIL PROTECTED] said:

>Grrr ...

>I have a package of code which I want to compile using a supplied csh
>script.  I cannot get it to execute.  The log reveals that it never
>recognizes the script as a command.  Of course, if I run it as ./compall 
>rather than
>compall
>then commands found further in te script don't work since they are not
>preceded by  ./  and I am stuck again.

You don't have "." in your path, so files are *not* considered executable
just because they are in the *current* directory.

This is a security feature.  (Some user could make a nasty script called
"ls"  or similiar in his home directoy.  If you try to look at his files
with ls the nasty script is invoked instead.)  Such protection isn't
necessary on a one-user machine, but it is a good idea anyway so the
home-users don't develop scripts that need "." in the path.

Ways of solving the problem:

1. Create ~/bin and add that to your path.  Put all private executables
   in ~/bin  You may want to set up you compiler to put freshly compiled
   files there too.  This works well and has no security problems.
   If you don't want to put your script in ~/bin, put a symbolic link to
   it there instead.

2. Add "." to path.  (Not recommended, but the script will run)

3. Change all local commands in the script to ./command

4. Put links to your script and other local executables somewhere in path,
   or move everything into a path directory.

Helge Hafting

Reply via email to