Grade Determination Shell Programming | os | 4th sem cse | operating system lab | QT

Опубликовано: 03 Ноябрь 2024
на канале: Quick Through
334
2

********** Welcome to Our Youtube Channel *************
operating system laboratory for cse engineering playlist
   • Operating System  

Exp. No. 4 Grade Determination Shell Programming

Aim
To write simple shell scripts using shell programming fundamentals.
The activities of a shell are not restricted to command interpretation alone. The shell
also has rudimentary programming features. Shell programs are stored in a file (with
extension .sh). Shell programs run in interpretive mode. The original UNIX came with the
Bourne shell (sh) and it is universal even today. C shell (csh) and Korn shell (ksh) are also
widely used. Linux offers Bash shell (bash) as a superior alternative to Bourne shell.

D) Grade Determination
Grade – grade.sh
echo -n "Enter the mark : "
read mark
if [ $mark -gt 90 ]
then
echo "S Grade"
elif [ $mark -gt 80 ]
then
echo "A Grade"
elif [ $mark -gt 70 ]
then
echo "B Grade"
elif [ $mark -gt 60 ]
then
echo "C Grade"
elif [ $mark -gt 55 ]
then
echo "D Grade"
elif [ $mark -ge 50 ]
then
echo "E Grade"
else
echo "U Grade"
fi

Output
$ sh grade.sh
Enter the mark : 65
C Grade