Running it with sh installtion.sh
guarantees you that the script is processed with sh
(i.e. you are responsible to know which language the script is written in), and installation.sh
must be in your working directory.
Running it with installation.sh
(which is only possible if the script is executable) guarantees that the script is processed with that language processor (sh, zsh, python,....) which is defined in the #!
line of the script. In addition, installation.sh
must be in some directory of your PATH.
It's up to you what you prefer; but if you do a chmod +x
, the user of the script can choose whether he is using the first or second variant. If you don't chmod it, the user of the script can only do the first variant.
A (perhaps small) side effect of setting the x-bit is that some tools (for example ls
) can be configured to colour executable files differently from non-executable ones, which may be helpful if you do a ls
of a bunch of files.