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

What is the syntax of "expr" command?

2 Answers  


What is shell scripting?

0 Answers  


What is a boot block?

0 Answers  


What are the different variables present in linux shell?

0 Answers  


Write a shell script in Linux to shift all characters in a file forward by five characters. (Thus “a” becomes “f’”).

2 Answers   Ignou, Tripura Info,


What is Linux language details

0 Answers   Quick Heal,


What language is shell scripting?

0 Answers  


How does ls command work?

0 Answers  


What is the default ubuntu terminal?

0 Answers  


c program the catches the ctrl-c(SIGINT) Signal for the first time and prints a output rather and exit on pressing Ctrl-C again

2 Answers  


What is use of "cut" command?

3 Answers  


Hi, i want to zip the files that generates automatically every few minutes (files generated are in .arc extension)....any body write a script for this... thanks in advance

5 Answers   HP,


Categories