It’s called a shebang, and tells the parent shell which interpreter should be used to execute the script.
#!/bin/sh <--------- bourne shell compatible script #!/usr/bin/perl <-- perl script #!/usr/bin/php <--- php script #!/bin/false <------ do-nothing script, because false returns immediately anyways.
Most scripting languages tend to interpret a line starting with #
as comment and will ignore the following !/usr/bin/whatever
portion, which might otherwise cause a syntax error in the interpreted language.
Related Posts:
- Ubuntu says “bash: ./program Permission denied” [closed]
- Should I put #! (shebang) in Python scripts, and what form should it take?
- Should I put #! (shebang) in Python scripts, and what form should it take?
- Why do people write #!/usr/bin/env python on the first line of a Python script?
- Who can access a file with octal permissions “000” on Linux/UNIX?
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- How to read a file into a variable in shell?
- Difference between sh and Bash
- What are the uses of the exec command in shell scripts?
- Meaning of “! -S” in shell script
- “No such file or directory” but it exists
- How do I pause my shell script for a second before continuing?
- How do I split a string on a delimiter in Bash?
- In the shell, what does ” 2>&1 ” mean?
- In the shell, what does ” 2>&1 ” mean?
- How do I copy a folder from remote to local using scp?
- How to concatenate string variables in Bash
- -bash: syntax error near unexpected token `)’
- An example of how to use getopts in bash
- How to delete from a text file, all lines that contain a specific string?
- How to mkdir only if a directory does not already exist?
- How can I check if a directory exists in a Bash shell script?
- How do I iterate over a range of numbers defined by variables in Bash?
- Why do people write #!/usr/bin/env python on the first line of a Python script?
- OS X: equivalent of Linux’s wget
- How to set ssh timeout?
- commands not found on zsh
- sudo: apt-get: command not found
- How do I iterate over a range of numbers defined by variables in Bash?
- How to mkdir only if a directory does not already exist?
- OS X: equivalent of Linux’s wget
- Using find to locate files that match one of multiple patterns
- “unary operator expected” error in Bash if condition
- What does “-ne” mean in bash?
- How can I declare and use Boolean variables in a shell script?
- Is there a Python equivalent to the ‘which’ command
- How can I declare and use Boolean variables in a shell script?
- How to generate random number in Bash?
- How to check if a variable is set in Bash?
- Shell Script Syntax Error: Unexpected End of File
- How can I compare numbers in Bash?
- Open and write data to text file using Bash?
- How to cat <
> a file containing code? - Given two directory trees, how can I find out which files differ by content?
- Which characters need to be escaped when using Bash?
- Shell script “for” loop syntax
- Diff command along with Grep gives “Binary file (standard input) matches”
- How do I set a variable to the output of a command in Bash?
- python getoutput() equivalent in subprocess
- What is the $? (dollar question mark) variable in shell scripting?
- Is there a TRY CATCH command in Bash
- dquote> result of a execution a program in linux shell
- Using sudo with Python script
- how to fix the issue “Command /bin/sh failed with exit code 1” in iphone
- Run a string as a command within a Bash script
- conditional binary operator expected in shell script
- Badly placed ()’s error with the following shell script
- Command to change the default home directory of a user
- Is there any simple way to benchmark Python script?
- Block Comments in a Shell Script
- Sorting data based on second column of a file
- Variable interpolation in the shell
- What does “&” at the end of a linux command mean?
- What does set -e mean in a bash script?
- What does set -e mean in a bash script?
- Syntax error near unexpected token ‘then’
- Shell script not running, command not found
- Using grep and ls -a commands
- source command not found in sh shell
- How to get a shell environment variable in a makefile?
- using rot13 and tr command for having an encrypted email address
- Shell Script: Execute a python program from within a shell script
- sed whole word search and replace
- What does ‘set -e’ do, and why might it be considered dangerous?
- What’s the difference betwen the single dash and double dash flags on shell commands?
- How to let ‘cp’ command don’t fire an error when source file does not exist?
- How to use execvp()
- How to use execvp() to execute a command
- What is a reverse shell?
- What’s a .sh file?
- How to pretty print XML from the command line?
- What’s a .sh file?
- How to execute a program or call a system command?
- What is newline character — ‘\n’
- Why does ENOENT mean “No such file or directory”?
- sudo: npm: command not found
- What are file descriptors, explained in simple terms?
- Extract substring in Bash
- How do I grep recursively?
- Where to place $PATH variable assertions in zsh?
- What is the preferred Bash shebang?
- How do I grep recursively?
- Why do you need to put #!/bin/bash at the beginning of a script file?
- What is the meaning of *nix?
- How do I use a regex in a shell script?
- How to grep for case insensitive string in a file?
- Difference between wait and sleep
- grep –ignore-case –only
- How to kill a process running on particular port in Linux?
- Multi-line string with extra space (preserved indentation)