In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what is the use of Linux's let command". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the use of Linux's let command"?
Let simple calculator that executes arithmetic expressions.
Summary let arg [arg...] The main purpose is to execute one or more arithmetic expressions.
Parameter arg: arithmetic expression
The return value returns 1 if the last expression executed by let evaluates to 0, otherwise 0. When the divisor of the expression executed by let is 0, 1 is returned and an error is reported.
Operator precedence decrement table operator describes id++, id-- variable increment, variable decrement + + id,-- id variable pre-increment, variable pre-decrement -, + positive sign, negative sign!, ~ logical No, inverse * * exponentiation *, /,% multiplication, division, remainder +,-addition, subtraction > move left by bit, move right =, compare = = ! = equal to or not equal to & bitwise and ^ bitwise XOR\ | bitwise or & & logic and\ | Logic or expr? Expr: expr conditional operator (ternary operator) =, * =, / =,% =, + =,-=, > =, & =, ^ =,\ | = assignment example # attempts to execute arithmetic expressions directly in the terminal (like IDLE in python). 3-4 bash:3+4:command not found... # another way. 3 + 4 bash:3:command not found... # it doesn't seem to work. # let command assignment. Let axioms 4 echo ${a} # shows 81. # (()) Is equivalent to the let command. ) # let is often used for variable assignment, while the external command expr can directly return the value of an expression. Let 3 # 4 # does not display 7. # displays 7 after execution, pay attention to the space. Expr 3 + 4 # conditional expression. If ((8 > 4)); then echo'8 is greater than 4.' Else echo 'error' fi # pay attention to the spaces. If [[12-le 10]]; then echo 'error' else echo' 12 is greater than 10.' Fi # can perform arithmetic operations by setting integer properties with the declare command. The # local command is similar. # No integer attribute specified, output as the string 'aroomb'. Declare axiom 3 bounded 4 c c=a+b echo ${c} # but you can assign values in the following ways. ((aqb)) echo ${c} # shows that 7 # can be added directly if the integer property is set. Declare-I axiom 3 bang 4 c c=a+b echo ${c} # Ibid. Declare-I a number 2, 3, echo ${a} # shows 6. Note that this command is a bash built-in command. For help, please see the help command.
In addition to let, there are external commands such as expr, bc, and so on.
At this point, I believe you have a deeper understanding of "what is the use of Linux's let command?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.