Linux command substitution: $ () "anti-quote"

Source: Internet
Author: User
Tags bz2

 $() Introduction to Commands:

Replaces a subcommand in a command with the result of its execution.

1 . command format:

$ (Commond)

2 . Command function:

Replace a subcommand in the command with the result of its execution, and take advantage of the substitution result.

3 . Command parameters:

/

4 . Command instance:

1, touch./file-$ (date +%f-%h-%m-%s). txt to create a TXT document with the current time.

[[email protected] test]# touch./file-$ (date +%f-%h-%m-%s). txt

[[email protected] test]# ls

100.sh myar.sh showdisks.sh Test3.txt

File-2016-10-11-09-21-05.txt mytartest.tar.bz2 sum1.sh

2. Echo "$ (PWD)" Displays the current directory

[[email protected] test]# echo "$ (PWD)"

/test


' anti-quote Introduction to Commands:

Replaces a subcommand in a command with the result of its execution.

1 . command format:

' Commond '

2 . Command function:

Replace a subcommand in the command with the result of its execution, and take advantage of the substitution result.

3 . Command parameters:

/

4 . Command instance:

1, touch./file-' Date +%f-%h-%m-%s '. txt creates a TXT document with the current time.

[email protected] test]# touch/files. ' Date +%f-%h-%m-%s '. txt

[[email protected] test]# ls

100.sh mytartest.tar.bz2 sum1.sh until.sh

Files.2016-10-11-09-19-25.txt mytartest.tar.gz test1.txt while.sh

hadoop.sh q.tar.bz2 Test2.txt

myar.sh showdisks.sh Test3.txt

2. Echo ' pwd ' Displays the current directory

[[email protected] ~]# echo ' pwd '

/root

This article is from the "Learn Linux history" blog, please be sure to keep this source http://woyaoxuelinux.blog.51cto.com/5663865/1860470

Linux command substitution: $ () "anti-quote"

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.