Shell bash and sh difference

    Shell Chinese meaning shells, meaning similar kernel shells. Shell refers to an application, the application provides an interface through which the user interface to access the operating system kernel services. Shell is a program written in C, it is the user to use Linux bridge. Shell is both a command language is a programming language.

    Shell script (shell script) is one for the shell script written. Often said that the shell usually refers to a shell script, but the shell and the shell script are two different concepts. Generally speaking, "shell programming" refer to shell scripting, does not refer to the development of the shell itself.

    sh (Bourne Shell) is an important early shell, 1978 Nian written by Steve Bourne, and released together with Version 7 Unix.

    bash (Bourne-Again Shell) is a program written for GNU Unix shell. 1987 created by Brian Fox. The main objective is to maintain consistency with the POSIX standard, taking into account compatibility with sh is Shell various Linux distributions standard configuration on Linux system / bin / sh often point to / bin / bash symbolic link.

    dash (Debian Almquist shell) one kind of Unix shell. It is smaller than Bash, requires less disk space, but it's also less sexual dialogue. It evolved from the NetBSD version of the Almquist shell (ash), in 1997 by the Herbert Xu (Herbert Xu) ported to Linux, renamed dash in 2002.

Meaning:

! # Is a special mark, indicating that it is an executable script. In addition to the first line, the other is no longer to take effect beginning with #, as a comment.

#! Followed by the path to the script interpreter program. This program can be a shell, programming language, or other common procedures, commonly used it is bash, sh.

    ! # / bin / the bash
    ! # / bin / SH

View:

    CAT / etc / shells may be used to view system shell type
     
    cat / etc / passwd view the current default settings, typically in the first line:
    the root: X: 0: 0: root: / root: / bin / bash
     
    LL / bin / sh sh view the current status of
    lrwxrwxrwx 1 root root 4 3 Yue 31 2018 / bin / sh -> dash

Guess you like

Origin www.cnblogs.com/cnhk19/p/11794234.html