Posts

Showing posts from January 24, 2019

Is it correct to use /bin/sh in the hashbang if the Bourne shell isn't available in a distribution?

Image
6 Generally, shell scripts contain the following comment at the first line of the script file: #!/bin/sh . According to the researches that I made, this is called "hash bang" and it is conventional comment. This comment informs Unix that this file is executed by the Bourne Shell under the directory /bin . My question begins in that point. Up to now I have not seen this comment like #!/bin/bash . It is always #!/bin/sh . However, Ubuntu distributions do not have the Bourne Shell program. They have the Bourne Again Shell (bash). In that point, is it correct to place the comment #!/bin/sh in shell scripts written in Ubuntu distributions? bash shell-script shell ubuntu shebang share | improve this