Back quotes, single quotes, double quotes in the Linux Shell

Source: Internet
Author: User
Tags echo command

The back quotation marks the top of the TAB key of the (') keyboard, and the 1 key to the left.
Plays the role of command substitution in Linux. Command substitution refers to the ability of the shell to interpolate the standard output of a command anywhere on a command line.
as follows, the shell executes the date command in the anti-quotation marks and inserts the result into the content displayed by the echo command.
echo Today is ' date '
Today is April 19, 2016 Tuesday 15:53:59 CST
  
Single and double quotation marks are used when the user assigns a string with a space to the variable's delimiter.
Str= "Today is Tuesday"
Echo $str
Today is Tuesday


If there is no single or double quotation marks, the shell interprets the string after the space as a command.

Str=today is Tuesday

./date.sh: Line 2:is: Command not found

The difference between single and double quotation marks. Single quotes tell the shell to ignore all special characters, while double quotes ignore most, but do not include $, \, '.

Such as:

echo "' Date '"

Output: April 19, 2016 Tuesday 16:09:17 CST

Echo ' Date '

Output: ' Date '

Back quotes, single quotes, double quotes in the Linux Shell

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.