PATH for scripts (was no subject)

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Victor Odhner
Date:  
Old-Topics: (no subject)
Subject: PATH for scripts (was no subject)
On Sun, 2004-01-18 at 13:38, Michael Havens wrote:
>I am teying my hand at writing a basic script.
> . . .
>So I type it in and then chmod 760 ...


Here is a side issue -- a minor detail that should
not affect this problem, but could bite you some other
time. So let me toss out a basic note on permissions:

I doubt 760 is what you want.

The 7 says you, the owner, can read, write and execute.
So that has nothing to do with your PATH problem.

The 6 says members of your group can read or *write*,
but can not execute. Both insecure and useless. ;-)

The 0 says those outside your group have no access.

Typically, if you want to give lesser permissions
for other users for an executable, it will be 5
(read + execute) or 0 (no access).

750 gives read+execute to members of your group.
755 gives read+execute to everybody.

Also note that the 'execute' bit (as in 7 or 5) is
also used on directories, to permit that directory
to be referenced or traversed. Most common trap here
is if I enter: chmod 666 * while in some directory,
I have locked *myself* out of its sub-directories
until I change that first 6 to a 5 or 7.

You also mentioned `sh dw` or `sh<dw` -- in fact,
these require only read permission on the script.
If you run the script by typing its name, that's
when you need the execute permission.

Vic