What are the test operators for the basics of shell scripts
Editor to share with you what the basic knowledge of shell script test operators are, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
I. the size of the integer tester; note: spaces must be left on both sides of the operator
[intnum1-eq intnum2] or [[intnum1-eq intnum2]]
-eq: equal to [intnum1-ne intnum2] or [[intnum1-ne intnum2]]-ne: not equal to [intnum1-gt intnum2] or [[intnum1-gt intnum2]]-gt: greater than [intnum1-ge intnum2] or [[intnum1-ge intnum2]]-ge: greater than or equal to [intnum1-lt intnum2] or [intnum1-lt intnum2]-lt: less than [intnum1-le intnum2] or [[intnum1-le intnum2]-le: less than, etc. Spaces on both sides of ((intnum1 = = intnum2)) can omit two numbers equal to returning true ((intnum1! = intnum2)). Two numbers are not equal to returning true ((intnum1 > intnum2)). Two numbers are greater than returning true ((intnum1 > = intnum2)). Two numbers are greater than or equal to returning true ((intnum1 < intnum2)). Two numbers are less than returning true ((intnum1).