Also what are the main differences between these two. To execute a script is it necessary to write this at the beginning of script?

marked as duplicate by cuonglm, Anthon, lcd047, Jenny D, G-Man Jun 21 '15 at 18:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


If you make a script executable, the loader will treat the first line as an interpreter directive and use the specific program to run the script. In this case you are using the Korn Shell or the Bourne Shell.

Not the answer you're looking for? Browse other questions tagged or ask your own question.