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?
- What’s a .sh file?
- How do I grep recursively?
- How to substitute shell variables in complex text files
- What is the difference between read and pread in unix?
- “sed” command in bash
- How to exclude a directory in find . command
- How to reload .bash_profile from the command line?
- Argument list too long error for rm, cp, mv commands
- Difference between using “chmod a+x” and “chmod 755”
- adb shell su works but adb root does not
- How to remove the quotes when reading a variable in jq in shell?
- What is the difference between tar and zip?
- Display current path in terminal only
- zip error – Nothing to do
- How to sort an array in Bash
- Run script on mac prompt “Permission denied”
- how to check which version of nltk, scikit learn installed?
- execvp: bad address error
- Running shell command and capturing the output
- Simple PowerShell LastWriteTime compare
- How do I write stderr to a file while using “tee” with a pipe?
- Can pm2 run an ‘npm start’ script
- How do I get the current Unix time in milliseconds in Bash?
- Is there a way to do a remote “ls” much like “scp” does a remote copy?