> > You are streching it a bit here. :) "#!" only signals execv() that > > is shuld use the folowing path to interpret the text-file. And > > 'magic numbers' are really not supported by the filesystem itself > > on UNIX. > > No, not by the filesystem. And nor should they be. I thought this was the > entire point of the conversation.
They should not be - true. :) > The operating system recognises several magic numbers as signifying > executable files. And yes, "#!" is a magic number. On this system > it is not in /etc/magic but it is built into the file command and the > same goes for ZMAGIC, NMAGIC and OMAGIC. Then you also might define the first 512 characters of a text file as a magic number too. If file(1) does not find any other 'magic number' it 'guesses' from the first 512 bytes. Try file(1) on a C-program that contains more than 512 bytes of non C-code. And "#!" doesn't uniqely distinguish a file - on the other hand a line starting with "#!" does. > > imc > -Frode

