#!/bin/bash hw1w=$1 hw2w=$2 exmw=$3 read -p "Please enter HW1 result : " hw1 read -p "Please enter HW2 result : " hw2 read -p "Please enter exam result : " exm whw1=$(echo "scale=2; ($hw1*$hw1w)/100" | bc -l) whw2=$(echo "scale=2; ($hw2*$hw2w)/100" | bc -l) wexm=$(echo "scale=2; ($exm*$exmw)/100" | bc -l) result=$(echo "scale=2; ($wexm+$whw2+$whw1)" | bc -l) echo "The final result is : $result " compare=$(echo " $result < 60 " | bc -l) if [ $compare -eq 1 ] then echo "Student fail the course" else echo "Student pass the course" fi