What is the need of including script interpreter in your
shell script?

Answers were Sorted based on User's Feedback



What is the need of including script interpreter in your shell script?..

Answer / abhijeet chavan (cts)

The script interpreter identifies using which shell the
script should be executed.
By default linux uses "bash" shell
Each shell has its own unique properties.

Is This Answer Correct ?    2 Yes 0 No

What is the need of including script interpreter in your shell script?..

Answer / 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

More Shell Script Interview Questions

Why should we use shell scripts?

0 Answers  


How can I Debug a shell scripts and Perl scripting?? or How do you debug a shell scripting and perl scripting ( at the compile time error or run time error) in Unix environment ?

4 Answers  


What is the use of "$#" in shell scripting?

0 Answers  


What is Path variable?What is its use?

1 Answers  


What is a file basename?

0 Answers  


What is shell chemistry?

0 Answers  


What are the four fundamental components of every file system on linux?

0 Answers  


i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..

0 Answers   Tech Mahindra,


How to find duplicate record in file using shell script?

0 Answers   IBM, Saama Tech, Wipro,


How to calculate the number of passed arguments?

0 Answers  


c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l

0 Answers  


What can scripts do?

0 Answers  


Categories