In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
You can test whether a condition is true with test or []. If the test result is true, the exit status of the command is 0, if false, the status is 1.
File testing
Format: test option file or [option file]
-b file block file
-c file character file
-d file directory
-e file exists
-p file pipeline
-r file readable
-s file greater than 0
-w file writable
-x file executable
F1-ef f2 F1 and f2 are linked to the same file (Korsh shell)
F1-nt f2 F1 is newer than f2
F1-ot f2 F1 is older than f2
The-a logic and the operator are true on both sides, and the result is true, otherwise it is false.
-o logical OR, either side of the operator is true, the result is true, otherwise it is false.
! Logic no, the condition is false, the result is true
Integer comparison test
Format: test int1 operator int2
-eq values are equal.
-ne values are not equal.
-the first number of gt is greater than the second number.
-the first number of lt is less than the second number.
-le the first number is less than or equal to the second number.
-ge the first number is greater than or equal to the second number.
N1-eq N2 N1 and N2 are equal
N1-ge N2 N1 is greater than or equal to N2
N1-gt N2 N1 is greater than N2
N1-le N2 N1 is less than or equal to N2
N1-lt N2 N1 is less than N2
N1-ne N2 N1 is not equal to N2
String test
Format: test option string or [option string]
= two strings are equal.
! = two strings are different.
-z empty string.
-n non-empty string.
S1 = S2 equal
S1! = S2 S1 is different from S2
S1
< s2 s1的ASCII在s2前 s2 >ASCII of S2 S1 after S2
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.