UNIX System administration: referencing

Source: Internet
Author: User
Keywords UNIX System Management
Tags administration change command line example it is returns send shell

To complete this chapter, you can do the following things:

Use a referral mechanism on the command line to ignore the special meaning of special characters

8.1 Introducing References

Many characters have a "special" meaning in the shell:

-Space

-Carriage return

- $

- #

- *

-< >

References eliminate (ignore) the special meaning of these characters.

In Unix systems, some special characters have special meanings for the shell, for example, spaces are delimiters for commands and arguments; carriage returns send a signal to the shell to execute the command, and the $ symbol is used to display the value associated with the variable name.

In some special cases, you do not want the shell to heed the special meaning of these characters, you only ask to retain the literal meaning, so UNIX must provide a mechanism to ignore or eliminate the special meaning of the specified character, this mechanism is called a reference.

8.2 Reference Symbols

Backslash \

Single quote '

Double quote "

The backslash eliminates the special meaning of the special character immediately following it.

Single quotes (') eliminate the special meaning of special characters. The special meaning of all special characters enclosed in single quotes is ignored. The single quotation mark itself cannot be ignored because it is used to close the quoted string.

Double quotes (") are nearly as inclusive, double quotes can remove the special meaning of most special characters, only the $ symbol (when it is used as a variable and the command substitution), and the backslash exception. So you can use a backslash in double quotes to get rid of the special meaning of the $ number.

8.3 References--

Syntax:

\ Remove the special meaning of the next character

Example:

$ echo the \ \ Escapes the next character

The \ escapes the next character

$ color=red\ white\ and\ Blue

$ Ehco The http://www.aliyun.com/zixun/aggregation/9541.html ">value of \ $ colore is $color

The value of $colore is red white and blue

$ echo One nonblank \

>three Loko

One nonblank three Loko

The backslash ignores the special meaning of the following character, with no exceptions.

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.