Re: what's the meaning of plain text file's executable attribute



On 2006-02-28, DaVinci <apple.davinci@xxxxxxxxx> wrote:
Q1:
a plain text file name aa.txt
/home/apple/study/note $ ls -l aa.txt
-rwxrwxrwx 1 apple apple 42 Feb 28 20:02 aa.txt
My question is what's the meaningof a plain 's executable attribute
,it is "x" bit.

It means it's executable.

as I know,a plain text file can't be executed.

You know wrong. A plain text file can be executed. If it
doesn't recognize it as a "native" executable format (ELF,
COFF) the kernel will treat it as a "script". If the file
doesn't specifity an interpreter via a "#!<path" line at the
top of the file, it will be be run by a default shell.

only the executable file ,such as /usr/bin/xpdf should have
the attribute of 'x'. so there is no meaning for the plain
text file to have the 'x' attribute,is it right?

No.

Q2:
what's the difference between interrupt and trap.
what I know is that interrupt include software interrupt and hardware
interrupt.
handware interrupt : I/O ,NMI...
software interrupt : divisor is zero...
divisor is zero is a trap.
but,what's more about the difference?

Generally, interrupts are caused by HW events asynchronous to
the program. Traps are generated by the program (either
intentionally or due to an illegal operation).

--
Grant Edwards grante Yow! Let me do my TRIBUTE
at to FISHNET STOCKINGS...
visi.com
.



Relevant Pages