Osv Lab Manual
Osv Lab Manual
(3141601)
2023-24
Academic Year: ____________
GYANMANJARI INSTITUTE OF TECHNOLOGY
BHAVNAGAR
CERTIFICATE
This is to certify that
Mr. / Ms___________________________________________
4th ,
Roll No.____ Enrollment No. _______________of semester ___
I.T.
branch _______________and batch _____ has satisfactorily
completed his / her term work as prescribed in syllabus and within the
premises of Gyanmanjari Institute of Technology, Bhavnagar in the
subject name Operating
__________________________code__________.
System and Virtualization 3141601
Faculty HOD
Date:
GYANMANJARI INSTITUTE OF TECHOLOGY
BHAVNAGAR
INDEX
NAME OF STUDENT : BRACH : I.T. .
ROLL NO : ENROLLMENT NO : BATCH : SEM : 4th .
SR.
PROGRAM TITLE DATE MARKS SIGN
NO.
1. Practical-1
2. Practical-2
3. Practical-3
4. Practical-4
5. Practical-5
6. Practical-6
7. Practical-7
8. Practical-8
9. Practical-9
10. Practical-10
11. Practical-11
12. Practical-14
Practical : 1
1. Echo
2. Cal
3. clear
4. Ls
5. Cd
6. Pwd
7. Mkdir
8. Rmdir
9. Mv
10. Cp
Practical : 2
1. Cat
2. Rm
3. Wc
4. Chmod
5. Exit
6. Uname
7. Sty
8. Who
9. Whoami
10. Date
11. Time
Page 1 of 8
fi
Practical : 3
3 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
echo "*****************"
echo "Student Marksheet"
echo "*****************"
echo "Enter Operating System Marks:"
read os
echo "Enater C++ Marks:"
read cpp
echo "Enater Java Marks:"
read java
echo "*****************"
total=`expr $os + $cpp + $java`
echo "Total Marks:"$total
percentage=`expr $total / 3`
echo "Percentage:" $percentage %
if [ $percentage -ge 60 ]
then
echo "Class: First Class Distinction"
elif [ $percentage -ge 50 ]
then
echo "Class: First class"
elif [ $percentage -ge 40 ]
then
echo "Class: Second class"
else
echo "Class: Fail"
echo “*****************"
Page 2 of 8
fi
Practical : 4
Practical : 5
Practical : 6
6 Write a shell script which will accept a number b and display rst n prime numbers
as output.
Page 3 of 8
fi
fi
read -p "Enter the NUmber: " n
echo "The prime numbers $n are: "
m=2
while [ $m -le $n ]
do
i=2
ag=0
while [ $i -le `expr $m / 2` ]
do
if [ `expr $m % $i` -eq 0 ]
then
ag=1
break
i=`expr $i + 1`
done
if [ $ ag -eq 0 ]
then
echo $m
m=`expr $m + 1`
done
Practical : 7
7 Write a shell script which will generate rst n bonnacci numbers like: 1, 1, 2, 3, 5,
13, …
Practical : 8
8 Write a menu driven shell script which will print the following menu and execute
the given task.
Practical : 9
9 Write a shell script to read n numbers as command arguments and sort them in
descending order.
done
echo "Numbers in Descending order: " ${arr[*]}
Page 6 of 8
fi
Practical : 10
10 Write a shell script to display all executable les, directories and zero sized les from
current directory.
Practical : 11
if [ "$vstr" = "$rvstr" ]
then
echo "String Is Palindrome."
else
Page 7 of 8
fi
fi
fi
fi
fi
fi
fi
fi
echo "String Is Not Plaindrome."
Practical : 14
14 Write a shell script to validate the entered date. (eg. Date format is : dd-mm-yyyy).
case $month in
4|6|9|11) max_days=30 ;;
2)
if ((year % 4 == 0 && (year % 100 != 0
|| year % 400 == 0))); then
max_days=29
else
max_days=28
;;
*) max_days=31 ;;
esac
if ((day > max_days)); then
echo "Invalid date"
else
echo "Valid date"
Page 8 of 8
f
fi
fi
fi