Shell quotes those things

Source: Internet
Author: User

#通配符 {} * []?

1.1 The difference between quotation marks and unquoted 1:

[[email protected] ~]# touch a B

[email protected] ~]# LL

Total 0

-rw-r--r--. 1 root root 0 June 16:25 a

-rw-r--r--. 1 root root 0 June 16:25 b

[[email protected] ~]# touch "a B"

[email protected] ~]# LL

Total 0

-rw-r--r--. 1 root root 0 June 16:25 a

-rw-r--r--. 1 root root 0 June 16:25 a B

-rw-r--r--. 1 root root 0 June 16:25 b

1.2 The difference between quotation marks and unquoted 2:

[email protected] tmp]# LL

Total dosage 0

-rw-r--r--1 root root 0 June 25 19:36?

-rw-r--r--1 root root 0 June 25 19:32 *

-rw-r--r--1 root root 0 June 19:33 AA

-rw-r--r--1 root root 0 June 19:33 ABC

-rw-r--r--1 root root 0 June 19:33 b

[email protected] tmp]# ll?

-rw-r--r--1 root root 0 June 25 19:36?

-rw-r--r--1 root root 0 June 25 19:32 *

-rw-r--r--1 root root 0 June 19:33 b

[email protected] tmp]# ll "?"

-rw-r--r--1 root root 0 June 25 19:36?

[email protected] tmp]# LL *

-rw-r--r--1 root root 0 June 25 19:36?

-rw-r--r--1 root root 0 June 25 19:32 *

-rw-r--r--1 root root 0 June 19:33 AA

-rw-r--r--1 root root 0 June 19:33 ABC

-rw-r--r--1 root root 0 June 19:33 b

[[email protected] tmp]# ll "*"

-rw-r--r--1 root root 0 June 25 19:32 *

1.3 double quotes and single quotation marks difference 1:

About $

[Email protected] ~]# echo "$LANG"

en_US. UTF-8

[Email protected] ~]# echo ' $LANG '

$LANG

1.4 double quotes and single quotation marks difference 2:

About ' '

[Email protected] ~]# echo "' which awk '"

/bin/awk

[[email protected] ~]# echo ' which awk '

' Which awk '

1.5 double quotes and single quotation marks difference 3:

About!

[[email protected] ~]# echo '!ll '

!ll

[Email protected] ~]# echo "!ll"

echo "Ll/bin/awk"

Ll/bin/awk

Shell quotes those things

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.