You are on page 1of 2

Experiment 4

Date- 16 January 2020


Objective- To write shell script to find area of circle
Software used- Linux operating system

Theory-
Commands:
$vi filename: to enter vi editor
$sh filename: to execute bash script

Bash script:
echo "Enter the radius of the circle"
read r
area=$(echo "3.14*$r*$r" | bc )
circum=$(echo "3.14*2*$r" | bc)
echo "area of the circle is " $area
echo "circumference of the circle is " $circum
Output:

Result: Bash script implemented successfully

You might also like