Shell internal Commands

Source: Internet
Author: User
Tags eval

The Bash command explains that the package program contains some internal commands. Internal commands are invisible in the directory list, and they are provided by the shell itself. Common internal commands are: Echo,eval,exec,export, ReadOnly, read, SHIFT, wait, and point (.). FG BG Jobs CD exit history follows a brief description of its command format and features.

1. Echo

Command format: Echoarg

Function: Displays a string specified by arg on the screen.

2. Eval

Command format: Evalargs

Function: When the shell program executes to the Eval statement, the shell reads the parameter args and combines them into a new command and executes.

3. Exec

Command format: EXEC command parameters

Function: When the shell executes to the EXEC statement, it does not create a new child process, but instead goes to execute the specified command, and when the specified command finishes executing, the process (that is, the original shell) terminates, so the statement after exec in the shell program is no longer executed.

4. Export

Command format: Export variable name or: Export variable name = variable Value

Function: The shell can use export to bring its variables down into the child shell, allowing the child process to inherit environment variables from the parent process. But the child shell cannot use export to bring its variables up into the parent shell.

Note: Export statements without any variable names will show all of the current export variables.

5. ReadOnly

Command format: readonly variable name

Function: Identifies a user-defined shell variable as immutable. The readonly command with no parameters will display all read-only shell variables.

6. Read

Command format: Read variable name table

Function: Reads a line from the standard input device, breaks it down into several words, assigns a value to the variables defined inside the shell program.

7. Shift statement

Function: The shift statement renames all positional parameter variables as follows, that is, the $1,$3 becomes a $ ... Each time the SHIFT statement is used in the program, all positional parameters are shifted one position to the left, and the position parameter $ #减1 until it is reduced to 0.

8. Wait

Function: Causes the shell to wait for the end of all child processes that are started in the background. The return value of wait is always true.

9. Exit

Function: Quit Shell program. You can optionally specify a digit as the return state after exit.

10. “.” Point

Command format:. Shell program file name

Function: Causes the shell to read into the specified shell program file and executes all the statements in the file in turn.

Jobs: print jobs and pending job information that are currently being executed in the background. The output information should be in a format that is easy for users to understand.

FG%<int>: Put <int> the job identified in the foreground to run, if the job has been stopped, then he continued to run. The shell should wait for the child process at the foreground to finish before printing a new command prompt line.

Bg%<int>: A suspended process that executes <int> identifies in the background.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.