Scripting: Stacking of commands
The first line of any script:
#!/bin/bash: The Interpreter path
In addition to the previous # number as a comment
Execute permission before script execution: chmod +x file name
Condition Judgment in bash:
Condition Test Type:
Integer test
Character test
File test
Conditional test expression:
[Expression]
[[Expression]]
Test expression
Integer comparison:
-EQ: Tests whether two integers are equal: For example, $a-eq $b, return 0 as equals
-ne: Test for two integers: unequal to true, equal to False
-GT: Test whether a number is greater than one number: greater than true, not quite false
-LT: Test whether a number is less than one number: less than true, not small for false
-ge: greater than or equal to
-le: Less than or equal to
if judgment condition; then
Statemtent1
.
.
Fi
Conditional Judgment of shell scripts