1. What is a Shell?

The shell is the shell, the shell of the operating system. Operate and control the operating system with shell commands, such as ls, cd, pwd, and so on.
In summary, a Shell is a command interpreter that starts, pauses, stops, or takes control of a computer by accepting Shell commands entered by the user

2. What is a script?

A script is a file made up of Shell commands that are the names of executable programs and can be run without compiling. It runs through an interpreter, so it is relatively slow

#! /bin/bash echo "this is the first shell script"

3. Shell and shell scripting?

A shell is an application that provides an interface through which users can access the services of the operating system kernel. Ken Thompson’s SH is the first Unix Shell, and Windows Explorer is a typical graphical Shell.

The shell script is a kind of script program written for the shell. What the industry says about shell usually refers to a shell script, but readers should know that shell and shell script are two different concepts. For the sake of brevity, the term “shell programming” used in this article refers to shell scripting, not developing the shell itself (such as Windows Explorer extension development)

Shell programming, like Java and PHP programming, requires only a text editor to write code and a script interpreter to interpret execution.

The shell interpreter comes with the default Linux installation.

4. What is Bash?

There are many kinds of shell interpreters and the most common one is bash. The default shell in Linux is the Bourne Again shell.

5. Bash Script

vim test. sh #! /bin/bash echo "this is the first shell script" • Vim common instructions:https://vim.rtorr.com Common usage, a bash script:https://www.cnblogs.com/lucius/p/10965638.html

Commonly used vim:

命令 说明
i Insert mode before cursor
Esc Exit insert mode
:w Save the file but do not exit the file
:wq or :x or ZZ Save and exit the file
:q! or ZQ Force exit files without saving changes

Shell scripts include:

信息 说明
*The script statement #! Tell the system what shell to use for interpretation
* Annotation information #Comment out
* Executable statement #The command