C – if-else

C – If-Else Statement The if-else statements are used to run specific code based on condition. The if statement executes a statement if a specified condition is true. If the condition is false, another statement can be executed. Basically, there are 4 types of if statements. if statement if-else statement if-else-if ladder statement nested if statement 1. if Statement An if statement evaluates the expression written inside the parenthesis. if (Expression) { // statement block } If the expression returns true, The if statement block will be executed. If the…

Read More

Bash – If-else

Bash if else Statment If-else is the decision making statements in bash scripting similar to any other programming. Where execution of a block of statement is decided based on the result of if condition. If it evaluates a condition to true, then if block code is executed, on the false condition, the else block code is executed, which is optional. Syntax:

basically, there are 4 types of if statements. if statement if-else statement else-if ladder statement nested if statement 1. Bash – if Statement Example This is the basic…

Read More