Bash test file test:
-F: Test whether it is a normal file, that is, ls–l file type---D: Test whether it is a directory file, that is, file type D when ls-l; e: The test file exists, the existence is true, otherwise false;-r: The test file is readable for the current user;-W: The test file is writable for the current user;-x: The test file is executable to the current user;-S: Test file size is not empty, not empty is true, empty is false;-C: Test whether the file is a character file
Bash condition test:
Integer test:
Greater than:-gt less than:-lt equals:-eq greater than equals:-ge less than equals:-le not equal to:-ne
Character test:
>: Greater than <: less than = =: equals =~: Determines whether the left-hand string can be matched by the right pattern, usually used for [[]];[[$opt 1 =~ $opt 2]] generally do the beginning of the line, the end of the anchor; do not add quotation marks; Monocular:-Z $STRING: Empty is true, not empty is false ;-N $STRING: Empty is false, not empty is true;
Short-circuit operation: As long as the first half of the paragraph can determine the final result, the second half of the operation is no longer; and operation: true && true = true && false = false false && {true | false} = FALSE or arithmetic: false | | False = False False | | true = True | | = True