filmov
tv
Scripting Using if condition in Bash Shell | Embedded Linux

Показать описание
Syntax:
if [ condition ]
then
statement
elif [ condition ]
then
statement
else
statement
fi
-------------------------------------------
Task:
1. Maximum between two numbers.
2. Maximum between three numbers.
3. Check whether a number is negative, positive or zero.
4. Shell Scripting Check whether a number is divisible by 5 or 11 or both or not.
5. Check whether a number is even or odd.
6. Check whether a year is leap year or not.
7. Check whether it is alphabet, digit, or special character.
8. Check whether it is vowel or consonant.
9. Program to input amount from user and print minimum number of notes (Rs. 500, 100, 50, 20, 10, 5, 2, 1).
if [ condition ]
then
statement
elif [ condition ]
then
statement
else
statement
fi
-------------------------------------------
Task:
1. Maximum between two numbers.
2. Maximum between three numbers.
3. Check whether a number is negative, positive or zero.
4. Shell Scripting Check whether a number is divisible by 5 or 11 or both or not.
5. Check whether a number is even or odd.
6. Check whether a year is leap year or not.
7. Check whether it is alphabet, digit, or special character.
8. Check whether it is vowel or consonant.
9. Program to input amount from user and print minimum number of notes (Rs. 500, 100, 50, 20, 10, 5, 2, 1).