Bash internal variable, Bash variable

Source: Internet
Author: User

Bash internal variable, Bash variable

Bash internal variables

Some internal commands are invisible in the directory list. They are provided by the Shell itself. Common internal Commands include echo, eval, execexport, readonly, read, shift, wait, exit and point (.)

Echo variable table

Display the specified variable in the variable table to the standard output.

Evalargs

Read The args parameters, combine them into a new command, and then execute

Exec Command Parameters

When the Shell executes the exec statement, it does not create a new sub-process, but instead executes the new command. When the specified command is executed, the process (that is, the original Shell) so the statement after exec in the Shell program will not be executed.

Export variable name = value

Shell can use export to break its variables down into the sub-Shell, so that the sub-process inherits the environment variables in the parent process, but the sub-Shell cannot use export to bring its variables up into the parent Shell

Readonly variable name

Quasi-input reading character bed from edge to pass to specified variable

Shift statement

The Shift statement renames all the location parameter variables as follows, that is, $2 becomes $1, $3 becomes $2... Every shift statement used in the program makes all positions move one position to the left at a time, and the position parameter $ # is reduced by 1 until it is reduced to 0.

Ssh-copy-id-I pub

Vi/usr/bin/ssh-copy-id

Example:

If ["-I" = "$1"]; then

Shift

# Check if we have 2 parameters left, if so the first is the new ID file

If [-n "$2"]; then

If expr "$1": ". * \. pub"; then

ID_FILE = "$1"

Else

ID_FILE = "$ 1.pub"

Fi

Shift # and this shouldleave $1 as the target name

Fi

Else

If [x $ SSH_AUTH_SOCK! = X]; then

GET_ID = "$ GET_ID ssh-add-L"

I can feel it. I just like it. Your likes are the greatest motivation for my progress.

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.