In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. Shell scripts are executed in a top-down, process-oriented order.
2. File name format: xxx.sh
3. First line of file content: #!/ bin/bash
4. Shell scripts are all about putting commands together.
5. define variables
Shell script variables are defined as: key=value, note: = can not have spaces on both sides
Static variable definition: a='www.ruozedata.com'
Dynamic variable definition: b=`date` #variable b is to get the current time, call b when the current time dynamically
The method that uses variables in shell scripts: ${variable}, if you use variable a, it should be ${a}.
6. if judged
Can judge: integer, decimal, string, folder exists, file exists, etc.
Format: if [space xx = yy space] Note: Use a single equal sign, with a space before, after and on both sides of the expression.
Examples:
if [ '$a' = 'www.ruozedata.com' ]; then
echo "D3"
fi
7. A few common ways to write for loop in shell
Category 1: Digital Cycle
Example 1:
#!/ bin/bash
for((i=1;i
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.