Hi, Files in *nix are not dependant on file extentions to know how the file should be dealt with, or what is reqired to work with it. Putting a "#" at the beginning of a text file is *normally* just a comment however ... UNIX looks at the first two bytes of a file to know what to do with it ... bang or "!" means basically return the following values outside of the file ... or return them to the shell for interpretation/execution (you can test this during an ftp connection ... another way to see the dir contents of the clients machine ... you can type !ls ... it returns the command to the client shell for interpretation). In other words... "#!" (also refered to sh'bang *hash bang*) means "execute the following as if it were from the command line" specifying #!/bin/sh means use bash shell to interpret the following code/script #!/usr/local/bin/perl means use perl to interpret the following commands. Absolute path is not *always* required (because you are just returning interpretation to the shell initially .... if perl is in your path the code/script will still work) This is a bad idea however and not really protocol. In C or C++ the text files (or files that contain instructions) are never returned to the shell ... they are compiled and linked using ... you guessed it a compiler and libraries =o) stating includes at the beginning of a file --> #include <iostream.h> tells the compiler to look in it's known path to include the information in the file iostream.h when compiling (certain functions or classes may require different *things* to be known by the compiler at compile time ... these files contain these *things* you'll learn more about these *things* as you continue your learning and reading =) hope this helps and have FUN~! Lonny Selinger >On Tue, 26 Sep 2000, you wrote: > > Hello, > > I just picked up a book called Beginning Linux Programming from Wrox. I have > just started reading this book, and there are some questions that I think they > assume I know, but don't. I need to find a book or a webpage that explains > several basic things. Like why does every file in C start with #! include?
Keep in touch with http://mandrakeforum.com: Subscribe the "[EMAIL PROTECTED]" mailing list.
