This shell script accepts the length and breadth of a rectangle from the user and finds the area of Rectangle.
Formula:
Area of Rectangle = Length x Breadth
Shell Script:
#/bin/bash #Shell Script to find the area of rectangle echo "Enter the length of the rectangle:" read length echo "Enter the breadth of the rectangle:" read breadth area=`expr $length \* $breadth` echo "Area of Rectangle = $area"
Output:
Enter the length of the rectangle: 15 Enter the breadth of the rectangle: 20 Area of Rectangle = 300