≡ Menu

Example of If Else Statement > Unix Shell Programming

You are Here: Home > Computer Subjects > Unix Shell Programming…

 

Example of If-Else Statement

Code:

clear

echo -n "Enter the Motorcycle name==> "
read b

if test $b = HONDA
then
	echo "The price of HONDA is Rs.56,000/-"
elif test $b = BAJAJ
then
	echo "The price of BAJAJ is Rs.44,000/-"
else
	echo $b "is not in the list."
fi

Output:

Enter the Motorcycle name==> HONDA

The price of HONDA is Rs.56,000/-

 

Click Here to Find Latest Jobs and Current Affairs