In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Example 1: tested by the `date` command in backquotes
[root@XCN ~] # echo '`date`' `date` # what you see in single quotes [root@XCN ~] # echo "`date`" Fri Jun 16 14:45:29 CST 2010double quotes if it is a variable, it will first parse the variable into the specific content in the display [root@XCN ~] # echo `date` Fri Jun 16 14:46:49 CST 2011generally do not add quotation marks for consecutive strings, it is generally safe to add double quotation marks It is recommended that [root@XCN ~] # echo $(date) Fri Jun 16 14:48:45 CST 2011uses () to print command input.
Example 2: test when calling after the variable is defined
[root@XCN ~] # xcn=dobe # create a variable without quotation marks [root@XCN ~] # echo $xcn # without quotation marks, display the parsed content of a variable dobe [root@XCN ~] # echo'$xcn' # single quotation marks, display a variable itself $xcn [root@XCN ~] # echo "$xcn" # double quotes, display the content of a variable, and the quotation marks can be variables, strings, etc.
Example 3:grep filter string example
[root@XCN ~] # cat > grep.logbodoxcn [root@XCN ~] # cat grep.logbodoxcn [root@XCN ~] # grep'$xcn' grep.log
Special example: example of awk calling shell variable quotation marks
[root@XCN ~] # XCN=123 [root@XCN ~] # awk 'BEGIN {print "$XCN"}' $XCN [root@XCN ~] # awk 'BEGIN {print' $XCN'} '123 suggests that the above results are exactly the opposite of the previous conclusion. This is a special use of awk calling shell variables
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.