0

I have seen some Linux scripts having Shebang different from the file extension.

Ex:

  • somefile.sh has #!/bin/bash inside it
  • somefile.ksh has #!/bin/sh inside it
  • somefile.bash has #!/bin/sh inside it

Can someone tell me what is proper naming convention to be followed while mentioning file extension and Shebang inside it?

muru
  • 72,889

1 Answers1

0

There is no relation between extension and shebang. Extensions are for users only.

Also for bash files you can use #!/bin/bash. And /bin/sh is usually a symbolic link to /bin/bash or /bin/dash, depends upon the system.

Prvt_Yadav
  • 5,882