Categories
Loops

if…else…fi

If given condition is true then command1 is executed otherwise command2 is executed. Syntax: if condition then condition is zero (true – 0) execute all commands up to else statement else if condition is not true then execute all commands up to fi fi example of nested if else osch=0 echo “1. Unix (Sun Os)” […]

Categories
Loops

if condition

if condition which is used for decision making in shell script, If given condition is true then command1 is executed. Syntax: if condition  then  command1 if condition is true or if exit status of condition is 0 (zero)  …  …  fi