$() 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"