What is the need of including script interpreter in your
shell script?
Answer Posted / ganesh
When you ask a shell to execute the command $ date, the
shell uses the system call exec to
ask the UNIX kernel to execute the command you requested.
The shell passes the name of the command that should be
executed to the exec system call.
This system call reads the first two characters in a file to
determine how to execute the command.
In the case of shell scripts, the first two characters are
#!, indicating that the script needs to be interpreted by
another program instead of executed directly.
The rest of the line is treated as the name of the
interpreter to use.
Usually the interpreter is /bin/sh, but you can also specify
options to the shell on this line
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What does $@ mean bash?
How do I run a .sh file?
Why is it called a shell?
What is shift command in shell script?
Tell something about the super block in shell scripting?
How do I read a .sh file?
What is the syntax of "nested if statement" in shell scripting?
In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?
What is the syntax of while loop in shell scripting?
Explain about stdin, stdout and stderr?
Explain about gui scripting?
How do I open the shell in cmd?
What is the crontab?
Is powershell a language?
Print the 10th line without using tail and head command.