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

Re: [cobalt-users] Problems running scripts



At 11:36 AM 2/19/00 -0500, you wrote:

Why can I not run scripts from the command line?

This is a Qube2.

    [admin@cobalt toyota]$ ls -l hello.cgi
    -rwxr-xr-x   1 admin    home           24 Feb 19 11:17 hello.cgi
    [admin@cobalt toyota]$ cat hello.cgi
    #!/bin/sh -w
    echo hello
    [admin@cobalt toyota]$ hello.cgi
    bash: hello.cgi: command not found
    [admin@cobalt toyota]$ sh hello.cgi
    hello

Scripts just don't run straight. This is also true for perl scripts:

Because you're confusing DOS with UNIX <smile>.

DOS implicitly includes the current directory in the path, so when you type in a program name it first tries it in the current directory before it searches the path.

UNIX (and Linux) doesn't. If you want the current directory in the path (considered to be insecure usage) you have to have it there, as "." (without the quotes) which is a shorthand for "the current directory". Or you can do what most of us do (which is considered much more secure, and run it this way:

[admin@cobalt toyota]$ ./hello.cgi

That should work fine.

This is the only server (BSD and RedHat Linux) where we have this issue.

Then on your other servers someone has put "." into the path, which as I've said, is considered insecure usage.

Jeff

--
Jeff Lasman <jblists@xxxxxxxxxxxxx>