If-Else Statement
There should always have space around the condition and [].
The variables and values should be specified inside " "
There has be to space between = sign, the variable and the value this is how comparison is done in shell else it will be considered as assignment operation.
Test Command
-e
: Check if file exist, -d
: Check if directory exist
-b
: Block special file (Non text files), -c
: Character special file (Text files)
-s
: Check if file is empty
Unix / Linux - Shell File Test Operators Example
Ternary Operator
Case Statement
The break and continue keyword is also present in shell scripting