Re: Execute permission of a file



That's not entirely correct.

"sh" is just the default shell. It will read "filename" and interpret it as
shell commands. The file only needs to be readable, as it's "sh" that's
being executed, not "filename".

/usr/bin/sh is usually linked to the Korn shell, so if the file does not
contain Korn script commands it will fail. i.e. A Perl script or even
Bourne script won't work, and a binary executable certainly won't!

The advantage of making a file executable is that you don't have to worry
about what to invoke it with: it could be Perl, Korn, or anything else and
you just have to run it and leave AIX to figure it out. (There are rules
governing how AIX does this: take a look at the man page for the "file"
command.)

--
Simon Green
Altria ITSC Europe s.a.r.l.

AIX-L Archive at https://lists.princeton.edu/listserv/aix-l.html

New to AIX? http://publib-b.boulder.ibm.com/redbooks.nsf/portals/UNIX

N.B. Unsolicited email from vendors will not be appreciated.
Please post all follow-ups to the list.


-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@xxxxxxxxxxxxx] On Behalf Of
faisalq . (faisalq)
Sent: 29 June 2006 14:12
To: aix-l@xxxxxxxxxxxxx
Subject: Execute permission of a file


Dear all,

Pl. bear with me, it may be a very naive question.

If a user can execute any file using 'sh filename' - even though he doesn't
have 'execute' permission, what is the significance of 'x' bit in unix?

A colleague asked this question, and i could not answer.


Thanks.



Relevant Pages