sh script if else statement

 

 

 

 

Bash scripting : If, FOR WHILE loop.If statement can be used without else part too. Example echo "Your number is greater than 100". fi. sh ifstatement.sh 34. statements. fi. the elif (else if) and else sections are optional.[ -z s2 ] (true if s2 has a length of 0, otherwise false). Example Script. number. sh. Shell. VBScript If Statement: Else. Sometimes you would like to have code executed with something is true and when something is false.