sh
sh is also called Bourne Shell. sh is a command programming language described by POSIX standard. It is for UNIX or UNIX-like operating systems. It has many implementations. On most operating systems, sh is implemented by programs like dash, kash, and original Bourne Shell. sh is a Predecessor of bash. /bin/sh is an actual link to main implementations. It is a symlink in most POSIX systems.
sh is not a programming language itself. It is just a specification. sh is a detailed description of the syntax and semantics of the language. It doesn’t include an implementation. sh is written as a replacement for earlier UNIX shells. It’s most of the syntax is the same as the syntax of the ALGOL68 programming language.
We should use sh if we want our language to be compatible with multiple systems. The sh script will most like run on bash also without modifications as bash is backward compatible with sh. sh is the most portable scripting language that works on most POSIX/Unix/Linux systems. One advantage of sh is that it is guaranteed to exist on everything that purports to Unix system.
Difference between sh and bash
bash and sh are two different shells of the Unix operating system. bash is sh, but with more features and better syntax. Bash is “Bourne Again SHell”, and is an improvement of the sh (original Bourne shell). Shell scripting is scripting in any shell, whereas Bash scripting is scripting specifically for Bash. sh is a shell command-line interpreter of Unix/Unix-like operating systems. sh provides some built-in commands. bash is a superset of sh. Shell is a command-line interface to run commands and shell scripts. Shells come in a variety of flavors, much as operating systems come in a variety of flavors. So, Shell is an interface between the user and the operating system, which helps the user to interact with the device.
Contact Us