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
Write a script to print the first 10 elements of fibonacci series.
c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l
How to get the 3rd element/column from each line from a file?
How to get the first line from a file using just the terminal?
What is the way to do multilevel if-else's in shell scripting?
I have 2 files and I want to print the records which are common to both.
What is a shell script? Can you name some of its advantages?
What is web script?
What is bash coding?
Is cmd a shell?
How to set an array in linux?
Write down the syntax for all the loops in shell scripting.
What does $@ mean in shell?
What is meant by $1 in shell script?
What are zombie processes?