In the case of a textual script file, if the first two characters of the file are the characters # and then !, the shell program that's used to interpret the file is taken from the rest of that line. (If not, the file is thrown at the default shell for that user. Since shell languages differ syntactically, this is to be avoided.)
Interpreters that are not considered shells can also be used if that script is written in the corresponding language.
Here are some typical examples you might find at the top of a
script:
#!/bin/sh # run with borne shell
#!/bin/csh # run with C shell
#!/usr/bin/perl # run a perl program
#!/usr/bin/perl -w # run a
perl program, with warnings turned on
#!/bin/bash # run specifically
with Bash shell
Pronounciation: this rule is usually pronounced The she-bang rule.
In unusual circumstances, you might encounter a directory that has no . entry. This might happen in special virtual directories created on the fly, such as entries in the /proc directory. Usually this is not a cause for concern unless you need to reference them.
You might also see directories with two or more . entries. Some software adds in the dot and/or the dotdot entries, artificially, because it anticipates that they don't already exist naturally. When they do, you see two of each, or more. This is harmless and you can, for instance, click on either to get your work done. Applications such as Tint cannot distinguish between them anyway. Because all of the system calls take a character string name, if you somehow end up with duplicate filenames in a directory (a highly irregular situation), all operations on that name will always work on the same instance.
See also . (dot directory)
Outside of Mac OS, the file is ignored.
| Documentation >
Glossary >
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0123456789 punctuation |
|
||||