EN
Linux bash correct first line header
1 answers
9 points
What is the correct first line when I create bash script?
1 answer
10 points
As I suppose that you are asking about first line of the script.
People uses bash
and sh
as substitutes but they are not the same.
Writing script it is necessary to set first line to indicates script interpreter.
xxxxxxxxxx
1
2
3
Depending what interpreter you whould like to use we can select Bourne shell, Bash shell or something other (python, php, perl, lua, ...).
Using Bourne shell first line should be:
xxxxxxxxxx
1
2
3
Using Bash shell first line should be:
xxxxxxxxxx
1
2
3
Summary:
bash
is like improvement forsh
.
Do not forget to add permissions to execute your script:
xxxxxxxxxx
1
chmod u+x my_script.sh
See also:
Resources
0 commentsShow commentsAdd comment