Write a shell script to generate marksheet of a student. Take 3 subjects, calculate and display total marks, percentage and Class obtained by the student. Program :-

 

Write a shell script to generate marksheet of a student. Take 3 subjects, calculate and display total marks, percentage and Class obtained by the student.


Program :-



#!/bin/bash

echo " Utsav Gohel 91900104011"

echo -n " MATHS = "

read mah

echo -n " PHYSICS ="

read phy

echo -n " CHEMISTRY ="

read chm

 

total=$(( $mah + $phy + $chm ))

echo " total = $total"

 

percentage=$(( $total / 3 ))

echo " percentage = $percentage "

 

if [ $percentage -ge 70 ]

then

  echo "DESTINTION CLASS"

elif [ $percentage -le 70 ] && [ $percentage -gt 60 ]

then

  echo "First class"

else

  echo "REGULAR class "

fi

 

 

Output :-