I was going through some shell script tutorials and found the following sample program:
#!/bin/sh
clear
echo "HELLO WORLD"
Can anyone please tell me what the significance of the comment #!/bin/sh at the start is?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s called a shebang, and tells the parent shell which interpreter should be used to execute the script.
Most scripting languages tend to interpret a line starting with
#as comment and will ignore the following!/usr/bin/whateverportion, which might otherwise cause a syntax error in the interpreted language.