0% found this document useful (0 votes)
162 views8 pages

COS 231 Introduction To UNIX - FINAL PROJECT

This shell script project provides a menu interface for students taking a COS231 Introduction to UNIX course. The menu allows students to access course materials like the syllabus, lecture notes, course projects and exams. It also displays a countdown of the time remaining in the semester, and weekly announcements relevant to upcoming deadlines or exams. Navigation is done through select menus to choose which material or submenu to view.

Uploaded by

silvanainfo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
162 views8 pages

COS 231 Introduction To UNIX - FINAL PROJECT

This shell script project provides a menu interface for students taking a COS231 Introduction to UNIX course. The menu allows students to access course materials like the syllabus, lecture notes, course projects and exams. It also displays a countdown of the time remaining in the semester, and weekly announcements relevant to upcoming deadlines or exams. Navigation is done through select menus to choose which material or submenu to view.

Uploaded by

silvanainfo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 8

COS 231 Introduction to UNIX, Spring 2008

Instructor: Prof. Karagiozov


INTRODUCTION TO UNIX
MENIU
Presented by: Radu Marin

Student ID: 100039745 Name: Radu Marin E-mail: [email protected]

1. Description:

This project purpose is to help all students who have taken COS231 and the
students who will take this course in the future. It is a project containing a welcome
message for each particular student, a short description of the course, a counter that
counts months, days, hours, minutes, seconds until the semester ends, a short description
of the activities of that week and a menu where students can access the syllabus of the
course, the lecture notes, the course project and the exams. The project contains 23 files
and it is made in shell programming.

clear (1) - clear the terminal screen


whoami (1) - print effective userid
cut - remove sections from each line of files
-c, --characters=LIST - select only these characters
echo (1) - display a line of text
date - print or set the system date and time
%d day of month (e.g, 01)
%m month (01..12)
%H hour (00..23)
%M minute (00..59)
%S second (00..60)
%j day of year (001..366)
expr (1) - evaluate expressions
select (2) - synchronous I/O multiplexing
cd (1p) - change the working directory
case (n) - Evaluate one of several scripts, depending on a give
more (1p) - display files on a page-by-page basis
break (1p) - exit from for, while, or until loop

2. Examples of using the program

The program can be used in COS231 – Introduction to Unix class and it can be used for a
personal documentation about UNIX Operating System.
3. Output Samples
4. Source code

clear
name=`whoami |cut -c 8-14`
echo "****** - - - Welcome $name to COS231 - - - *******"
echo
echo " "An introduction to the UNIX operating system from the user.s
point of view. Covers the basic structure of UNIX, the basic set of commands, file
syste m, editors, utilities and shell programming. 3 Cr.
echo " "This is a practical, hands-on course that teaches the
fundamentals of the UNIX operating system concepts, architecture and
administration. These concepts are taught using Linux, a free, PC-compatible
UNIX clone that is an ideal teaching tool for many basic and advanced UNIX
commands.
echo

day=`date '+%d'`
day2=`date '+%j'`
month=`date '+%m'`
hour=`date '+%H'`
minutes=`date '+%M'`
seconds=`date '+%S'`

echo Semester ENDS in:

number_days=`expr 130 - $day2`


echo `expr $number_days / 7` weeks `expr $number_days % 7` days - `expr 24 - $hour` h
`expr 60 - $minutes` min and `expr 60 - $seconds` sec

echo
if [ $month = 04 ] && [ $day '>' 06 ] && [ $day '<' 14 ]
then
news=`echo Wednesday April 09 deadline for regxp/awk take-home quiz.`

elif [ $month = 04 ] && [ $day '>' 13 ] && [ $day '<' 21 ]


then
news=`echo Quiz and April 16 deadline for Projects.`

elif [ $month = 04 ] && [ $day '>' 20 ] && [ $day '<' 28 ]


then
news=`echo Project Presentation week - Final Exam preparation.`

elif [ $month = 04 ] && [ $day = 28 ]


then
news=`echo Orthodox Easter Monday Holiday.`

elif [ $month = 04 ] && [ $day = 30 ]


then
news=`echo Today is the last day of classes! Good luck on Finals ;)!`

elif [ $month = 05 ] && [ $day = 01 ]


then
news=`echo Labor Day Holiday!`

elif [ $month = 05 ] && [ $day '>' 04 ] && [ $day '<' 12 ]


then
news=`echo Final week! Good luck on final exams! See you next year!`

fi

echo Week News: $news

echo
echo Please select your choice:
echo

select fname in Syllabus "Lecture Notes" "Course Project" Exams Quit

do
clear

if [ "$fname" = "Quit" -o "$fname" = "" ]


then
exit
fi

if [ "$fname" = "Course Project" ]


then
echo You picked Course Project
echo

select fname2 in Course_Projects Project_Specification Back

do
cd Course_Project
clear

case $REPLY in
1) clear; more $fname2; clear;;
2) clear; more $fname2; clear;;
3) clear; break;;

esac

echo Press ENTER to continue!

done
cd ..

fi

if [ "$fname" = "Exams" ]
then
echo You picked Exams
echo
select fname3 in "Midterm_Preparation" "Rules_Final_Exam" Back

do
cd Exams/
clear

case $REPLY in
1) clear; more $fname3; clear ;;
2) clear; more $fname3; clear ;;
3) clear; break;;
esac

echo Press ENTER to continue!


done
cd ..
fi

if [ "$fname" = "Syllabus" ]

then
echo You picked Syllabus
echo
select fname4 in "Syllabus" Back

do
cd Syllabus/
clear

case $REPLY in
1) clear; more $fname4; clear ;;
2) clear; break;;
esac

echo Press ENTER to continue!


done
cd ..
fi

if [ "$fname" = "Lecture Notes" ]


then
echo You picked Lecture Note
echo
select fname5 in Lecture_1_Intro Lecture_2_Start Lecture_3_Commands
Lecture_4_File_Struct Lecture_5_File_Struct Lecture_6_Shell Lecture_7_Shell
Lecture_8_Vi Lecture_9_Reg_Exp Lecture_10_Shell Lecture_11_Sed_Awk
Lecture_12_awk Lecture_13_awk Lecture_14_Perl Lecture_15_Perl Lecture_16_Perl
Lecture_17_Perl Back

do
cd Lecture_Notes/
clear
case $REPLY in
1)clear; more $fname5; clear;;
2)clear; more $fname5; clear;;
3)clear; more $fname5; clear;;
4)clear; more $fname5; clear;;
5)clear; more $fname5; clear;;
6)clear; more $fname5; clear;;
7)clear; more $fname5; clear;;
8)clear; more $fname5; clear;;
9)clear; more $fname5; clear;;
10)clear; more $fname5; clear;;
11)clear; more $fname5; clear;;
12)clear; more $fname5; clear;;
13)clear; more $fname5; clear;;
14)clear; more $fname5; clear;;
15)clear; more $fname5; clear;;
16)clear; more $fname5; clear;;
17)clear; more $fname5; clear;;
18)clear; break;;
esac
done
cd ..
fi

done

You might also like