The built- in command (build-in commands) is the command of the shell Build-in, and when built-in commands are used, the shell executes directly without creating a new child process. Built-in commands are used to create functional or convenient builds.
Bash supports built-in commands of type 3
- Bourne Shell Build-ins
:,. Breakcdcontinueevalexecexitexportgetoptshash pwd Readonlyreturnset Shift Test[timestrapumaskunset
- Bash build-in Commands
Aliasbindbuiltincommanddeclare Echo Enablehelpletlocallogoutprintfreadshopttypetypesetulimitunalias.
- Special built-in command special Build-ins
When you run the POSIX mode, the main differences are the following 3 aspects
- Special built-in commands are found first (I don't know if that's right.) Original: Special build-ins is found before shell functions during commands lookup)
- If a built-in command returns an error code, then if the shell is non-interactive (non_interactive), then the shell exits.
- After the command execution is complete, the side effects of the copy statement will remain. (For safekeeping: Assignment Statements preciding the command stay in effect in the shell environment after the commands complete)
Starting a program execution from the shell
When the program is launched through the shell, Bash will fork out a subshell,subshell that will immediately read the parent Shell's command, and the command will be executed until the execution is completed or interrupted by the keyboard. Then Subshell will execute all the commands and the parent shell will wait for it to complete. When the Subshell executes and ends, the parent shell is awakened and the statement is re-printed at the terminal.
Bourne again shell built-in command