CS212 FINALSLab Activty
CS212 FINALSLab Activty
case "${new_status^^}" in
A)
employment_status="RETIRED"
echo "STATUS of $first_name $middle_initial $last_name changed
to RETIRED"
;;
B)
employment_status="RESIGNED"
echo "STATUS of $first_name $middle_initial $last_name changed
to RESIGNED"
;;
C)
employment_status="ACTIVE"
echo "STATUS of $first_name $middle_initial $last_name changed
to ACTIVE"
;;
*)
echo "Invalid choice. No changes made."
;;
esac
else
echo "No changes made."
fi
}
#Read phonebook file
read -p "Please enter the Phone Number : " phone_number
phonebook_entry=$(grep "$phone_number:" "$phonefile")
if [ ! -e "$phonefile" ]; then
echo "Phonebook file not found."
exit 1
fi
# Display details
display_details
2. Edit Employment Status – option for editing an employee’s job status. You can
change it to three options:
A. Retired
B. Resigned
C. Active
After choosing, the script changes the job status for that employee accordingly.
3. Compute Employment Duration – this option shows how long employees have been
active within their respective jobs.