What is the difference between "in shell?

Source: Internet
Author: User

1. Difference between single quotes and double quotes

Single quotation marks: A single quotation mark can only contain general characters without special characters. Double quotation marks include special characters.

Example:

# Name = vbird

# Echo $ name

Vbird

# Myname = "$ name its me"

# Echo $ myname

Vbird its me

# Myname = '$ name its me'

# Echo $ myname

$ Name its me

 

2. quotation marks ('): in a string of commands, the commands in quotation marks are executed first, and the execution results are used as external input information.

Example:

# Ls-l 'locate crontab'

First, use the locate command to list all the file name data and then use the LS command for processing.

Reference: laruence Linux basic learning for private dishes 11.2.1

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.