Is SH Bourne shell?

Is SH Bourne shell?

The Bourne shell is the original UNIX shell (command execution program, often called a command interpreter) that was developed at AT. Named for its developer, Stephen Bourne, the Bourne shell is also known by its program name, sh.

What is sh compatible shell?

GNU Bash. Bash is the GNU Project’s shell—the Bourne Again SHell. This is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and the C shell (csh). It is intended to conform to the IEEE POSIX P1003.

What does sh mean in Linux?

sh stands for “shell” and shell is the old, Unix like command line interpreter. An interpreter is an program that executes specific instructions written in a programming or scripting language. So basically you say “Execute that file for me”.

Is there such a thing as a bin / sh shell?

The /bin/sh shell is supposed to be a shell that implements the POSIX shell standard, regardless of what the actual shell is that masquerade as the /bin/sh shell. #!/bin/sh is normally just a link now as the Bourne shell is no longer maintained.

Why is the “-” in the ” # bin / sh-” Shebang?

As on most systems the shebang mechanism allows only one argument after the interpreter path. As to whether to use #! /bin/sh – vs #!/bin/sh -, that’s just a matter of taste. I prefer the former as it makes the interpreter path more visible and makes mouse selection easier.

What’s the difference between Bourne shell and Bash?

Either way, the original Bourne shell is sh, so if your script uses some bash (2nd generation, “Bourne Again sh”) specific features ( [ [ ]] tests, arrays, various sugary things, etc.), then you should be more specific and use the later. This way, on systems where bash is not installed, your script won’t run.

Why does the script work without mentioning the shebang?

As for the reason why sometimes the script works without mentioning the Shebang is because, the script which you are trying to run is a valid script in your current shell. The Shebang for shell script is mostly not necessary when your code is independent of the type of shell, and would run on any type (