Interpreter directive
Appearance
![]() | It has been suggested that this article be merged with Shebang (Unix). (Discuss) Proposed since June 2014. |
An interpreter directive is a computer language construct that is used to control which interpreter parses and interprets the instructions in a computer program.[1] It is also commonly referred to as an interpreter designator.
- In Unix, Linux and other Unix-like operating systems (OS) the the Shebang (#!) command is the first line in a script, as it is used to tell the OS shell that this file is to be executed and what scripting language to use when executing the script commands.
An example would be #!/bin/bash, meaning run this script with the bash shell found in the /bin directory. The file system permissions must also be set so the script may be executed.[2][3][4] [5][6] [3][7] [3][8]
- Other systems or files may use some other magic number as the interpreter directives. (Shebang's #! magic number is a code value 23 21 followed by the path to an interpreter.)
See also
- List of scripting languages
- Architecture description language
- Command line interpreter
- Shebang (Unix)
- Bourne shell
- Bourne-Again shell
- C shell
- Python (programming language)
- Filename extension, Command Name Issues section
- Perl
- Scripting language
- Unix shell
References
- ^ Weik, Martin H. (2000). Computer Science and Communications Dictionary. Vol. Volume 1. Springer. p. 829. ISBN 978-0-7923-8425-0.
{{cite book}}
:|volume=
has extra text (help); Cite has empty unknown parameter:|month=
(help) - ^ "Advanced Bash Scripting Guide". Retrieved 2012-01-19.
- ^ a b c "The #! magic, details about the shebang/hash-bang mechanism". Retrieved 2012-01-19.
- ^ Cooper, Mendel (November 5, 2010). Advanced Bash Scripting Guide 5.3 Volume 1. lulu.com. p. 5. ISBN 978-1-4357-5218-4.
- ^ MacDonald, Matthew (2011). HTML5: The Missing Manual. Sebastopol, California: O'Reilly Media. p. 373. ISBN 978-1-4493-0239-9.
- ^ Lutz, Mark (September 2009). Learning Python (4th ed.). O'Reilly Media. p. 48. ISBN 978-0-596-15806-4.
- ^ Lie Hetland, Magnus (October 4, 2005). Beginning Python: From Novice to Professional. Apress. p. 21. ISBN 978-1-59059-519-0.
- ^ Schitka, John (December 24, 2002). Linux+ Guide to Linux Certification. Course Technology. p. 353. ISBN 978-0-619-13004-6.