UNIX/ Linux | Conditional Statements | Exp - 9



Conditional Statements

Unix provides a number of relational operators in addition to the logical operators mentioned earlier. These can be used to compare numeric values.
  • -lt less than
  • -le less than or equal to
  • -gt greater than
  • -ge greater than or equal to
  • -eq equal to
  • -ne not equal to
Unix provides a number of ways for conditionally executing the other commands.
These are covered below:
1. The if statements
Example:
if <control command>
 then
 <statements>
 fi
2. The if…else statements
Example:
if <control command>
 then
 <statements>
 else
 <statements>
 fi
3. The if…elif…else…fi statement
Example:
if <control command>
 then
 <statements>
 elif
 then
 <statements>
 else
 <statements
 fi

For more info visit Software Testing help

Problem Statement

A user entered the any parameters of any objects to find largest among them ,if two parameters are same then print same parameter.

File: Download here 

No comments:

Powered by Blogger.