Shell substitution: Shell variable substitution, command substitution, escape character

Source: Internet
Author: User
Tags delete key echo command

If the expression contains special characters, the Shell will replace it. For example, using a variable in double quotes is a substitution, and an escape character is also a substitution.


As an example:
    1. #!/bin/bash
    2. a = Ten
    3. Echo-e "Value of A is $a \ n"
Operation Result:
Value of A is 10
here-e indicates the substitution of the escape character. If you do not use the-e option, it is output as-is:
Value of A is 10\n

The following escape characters can be used in Echo:
Escape Character meaning
\\ Back slash
\a Alarm, Bell
\b BACKSPACE (delete key)
\f Page Break (FF), moving the current position to the beginning of the next page
\ n Line break
\ r Enter
\ t Horizontal tab (Tab key)
\v Vertical tab
you can suppress escaping by using the-e option of the Echo command, which is not escaped by default, or by using the-N option to prevent the insertion of line breaks.

This article is from the Linux Security Advisor blog, so be sure to keep this source http://chengyangyang.blog.51cto.com/9473151/1700113

Shell substitution: Shell variable substitution, command substitution, escape character

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.