Operating Systems Lab
CSE · Final · Spring 26
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
Operating System Lab Final Exam
Time : 35 min ; Marks : 25
1. Write a shell script program named passwordChecker.sh, which will identify the flaws of a password based on the condition given below.
i. If the length of the password is less than equal 10 : it will print "Password needs to more than 10 characters"
ii. If the The password doesn't contain any numbers then it will print "Password must contain at least one number"
iii. If the password does not contain any special characters then it will print "Password must contain a special character."
If all the conditions mentioned are properly satisfied then it will print "All good" and append the password in a file named StrongPassword.txt.
15
Input | Output
akiz | Password needs to more than 10 characters
akizwithten | Password must contain at least one number
akizwith10 | Passwords must contain a special character.
akizwith10@ | All good
[appends the password in a file named StrongPassword.txt]
2. Create a shell script program named sumOfdigits.sh, where you will pass your last 3 digits of your id as an argument and it will calculate the sum of the last 3 digits of your id and print it in the terminal.
10
Input | Output
213 | 6
920 | 11