Introduction to Unix/Linux

CS160B Syllabus

CRN 71540-931 Fall 2022

This syllabus is also available as a printable PDF document which can be printed.

Course Description

Analyze, design, write, test, and debug shell scripts. Students learn basic shell scripting techniques and develop scripting skills needed for Unix/Linux System Administration courses. The bash shell is used.

Prerequisites/corequisites/advisories

CS 160A - Introduction to Unix/Linux

Student Learning Outcomes

Upon completion of this course, a student will be able to:

§ Use command substitution to capture program output.

§ Use conditional statements to control the execution of shell scripts.

§ Write shell scripts to perform repetitive tasks using while and for loops.



§ Design and implement shell functions.



§ Identify and process command-line arguments.



Class Meetings

Materials will be online 24/7 for access. Optional class meetings will be offered. The meetings will be recorded and posted under CityZoom link, under Recordings tab. Depending on student demand, optional sessions may be offered during the week for students to work with teacher and/or TA to go over problems. Additional one on one meetings between students and teacher can be requested over the course of the semester. To request a one to one session, please email the instructor.

Instructor Contact

JoAnne Strickland

Email: jstrickland@ccsf.edu

Phone: (707) 260-5622

Office Hours: TBA and upon request

I will respond to all course email within 48 hours, exclusive of school holidays, but will strive to respond within 24 hours regardless of weekends or holidays. For urgent questions/help, phoning or texting is welcome. Please keep to standard hours 8 am to 11 pm, every day of the week. I will be in classes on and off, so please leave a detailed message and I will respond at the earliest convenient time.

Feedback will be found in the grades here for each discussion/quiz/assignment. Expect assignments to be graded within two weeks of submittal or a week after they are due on the guidelines on the Schedule, whichever is later.

Course Web Site

Use the Canvas Learning Management system for accessing class materials, assignment instructions, submitting assignments, taking quizzes, viewing classmates' work, sharing resources, and viewing grades. Our Canvas classroom can be located through the CCSF website links for Canvas, or directly by going to Canvas Classroom Direct Link

You must log into Canvas to access the course directly from this link or can type ccsf.instructure.com.

OUR CLASSROOM FROM MYCSSF

The class website can be reached by going to www.ccsf.edu, then click on the MyCCSF link, then the Log into Canvas link. When you log in there you will need a RAM ID to access the class. You can also access directly the Canvas classroom by going to ccsf.instructure.com.

You should also email me, jstrickland@ccsf.edu, and inform me of any issues you may be having with the Canvas classroom. You can also call me at 707 260-5622 for any reason as well. Please be assured I will return your call within 24 hours if I am not able to answer directly.

First thing is to check the Courses Link and then select your course. This will take you to the Home Page of the website.

On this syllabus, which you should read in full, you will find the required textbook for the class. You will also see a schedule in the first module which has due dates and other information. The schedule is subject to change a little but for the most part it will remain consistent.

THE CANVAS INTERFACE.

Guidance is provided for navigating and using tools of Canvas in the Canvas introduction module at the top of the modules page.

CONTENTS OF COURSE

1. Review of Basic Unix Concepts

1. Shell differences

2. Script basics

3. Working with files and directories

4. Using find to locate files and directories by name pattern and type

5. Manipulating file attributes: owners, groups and permissions.

6. Using text filters such as head, tail, cut, tr, sort, uniq, grep, sed and awk.

7. Basic regular expressions

2. Shell Programming

1. Script Basics

2. Variables

1. local

2. environment

3. Substitution

1. shell wildcards

2. variable

3. command, including backquote and $(...) forms

4. arithmetic, including expr and $((...)) forms

4. Quoting

1. backslashes

2. single quotes

3. double quotes

4. quoting rules

5. Flow Control

1. the test command

2. the if statement

3. the case statement

4. conditional operators && and II

6. Loops

1. the for loop

2. the while loop

3. break and continue

7. Documentation

1. Comments

2. Indentation

8. Parameters

1. special variables ($#, $*, $0, $1 ...)

2. options and arguments

3. using 'set' to set command line arguments

4. command-line option parsing in shell scripts

9. Input/Output file descriptors and redirection in scripts

1. standard input, standard output, and standard error

2. output redirection, including: > 2> >> and 2>>

3. input redirection, including < and <<

4. combining output streams using: 2>&1 >&2

5. using the read command to read data from files and interactively from the user

10. Functions

1. creating and using functions

2. scoping issues

11. Miscellaneous Topics

1. re-evaluation of the command using eval

2. the null command (:)

3. using type to show how commands are resolved

4. using sleep to implement delays

5. use of temporary files with unique filenames generated using $$ or mktemp

6. creation and use of variables containing file paths

7. sourcing using the . (dot) operator

3. Advanced Topics

1. Debugging

1. shell tracing

2. adding conditional debugging code

2. Function Libraries

1. creating a library of functions

2. useful functions

3. Steps in designing a script

4. Techniques for increasing portability

Required Textbook

TEXTBOOK A

The Linux Command Line

Third Internet Edition

William Shott

See pdf link on Canvas (PDF is provided to you)

TEXTBOOK B

Mastering Linux Shell Scripting 2nd Edition by Mokhtar Ebrahim , Andrew Mallett

Packtpub.com Mastering Linux Shell Scripting 2nd Edition ISBN 9781788990554 $28.99 - $36.99

Required Software

Hills may be accessed from any computer that has internet access. To access hills, use any SSH or terminal emulation program, such as:

§ On Windows, you can use PuTTY (follow the "download" link, then select the appropriate MSI ("Windows Installer"): 32-bit or 64-bit.)Links to an external site. or even simpler, you can look under "Alternative binary files" and click on "putty.exe" for your system, to download the executable file directly.

This video demonstrates how to login to hills from a PC.Links to an external site.

§ On a Mac or Linux computer, open a Terminal window and type:

ssh uname@hills.ccsf.edu

(Put your hills login name in place of "uname" above.)

This video demonstrates how to login to hills from a Mac.

Grading Scale

The final grade for this class is made up of three components:

Exercises/Scripts 40%

Quizzes 40%

Final Exam 20%

Extra credit points are available. Final scores will be tallied with standard A-F scores.

Office Hours

Office hours can be offered by zoom or via email or chat by request. I will be holding optional class meetings throughout the semester.

How to Make an Appointment

Please call, email or text to arrange an appointment and specify available days/times for you. Also note how much time you wish to reserve (15 minutes, 30 minutes, etc). I will confirm a day and time with you via email. I will put a slot open for you at that time. On the day of the appointment, I will send you a link a few minutes before the appointment

Optional Class Meetings

Optional class meetings may be given weekly and are not required. Dates/times are TBA.

To attend the optional class meeting, go to the CityZoom link to the left and select it. Find the link for the optional class meeting and click it, then press the JOIN button. You're In!

Videos of optional class meetings will be posted in the CityZoom page, under the Recordings tab.

Important Dates

Day Class Begins: October 24, 2022, Monday

Day Class Ends: December 20, 2022, Tuesday

Last Day to Add – November 1, 2022, Tuesday

Last Day to Drop with refund - October 27, 2022

Last Day to Drop without a W – November 1, 2022

Last Day to Drop with a 'W' symbol: December 6, 2022

Census Date – November 2, 2022

Final Exam Time Period: December 15-20, 2022

Dropping the Class

If you decide to discontinue this course, it is YOUR responsibility to officially drop it to avoid getting no refund (after 10% of course length), a W symbol (after 20%), or a grade (after 60%). Also, for several consecutive, unexplained absences, the instructor may drop a student.

PassNoPass (P/NP)

You may take this class P/NP. You must decide before the deadline, and add the option online or file the P/NP form with Admissions and Records. With a grade of C or better, you will get P. You must file for the P/NP option by the due date. Once you decide to go for P/NP, you cannot change back to a letter grade. If you are taking this course as part of a certificate program, you can probably still take the class P/NP. Check with a counselor to be sure.

Instructor Announcements and Q&A Forum

I will post regular announcements on the “Instructor Announcements” page in Canvas throughout the semester. Canvas notifies students according to their preferred Notification Preferences as soon as the instructor creates an Announcement. A “Q&A Forum” is also on Canvas to ask for assistance of your classmates or of me.

Attendance

Students who fail to attend the first class (face-to-face courses) or do not log-in to an online class after the second week will be dropped from the class. If you intend to take the course, please take the Syllabus Quiz by the end of the first week. If you DO NOT take the quiz, you will be dropped at the Census date. It is strongly advised that if you need to miss more than one class/homework deadline in a row that you contact me to avoid being dropped from the class. Attendance is posting to Discussions at least once and replying to classmates at least once in EACH discussion forum.

Late Policy

All assignments are due at 11:59 pm of the night of the due date listed. Submissions that are submitted after the last day of class will not be accepted without prior arrangement. Late work will not be graded unless the student sends the instructor an email with explanation for late work or requests an incomplete.

Methods of Evaluation

I look at the overall knowledge of each student before I assign final grades. I look at the homework assignments to see if the student can analyze a problem statement and use the appropriate statements to implement the requirements of the problem statement. There are normally several ways to solve a problem, so all solutions that work are acceptable, but as we learn, we shoot for optimization and simplicity with no redundancy in the code.

Exams

There will be online quizzes and a final exam. The quizzes may be taken anytime before the due date and the final exam is open during the entire week of finals. The material comes from the textbook, class lectures and supplemental materials. If any quiz or exam is missed, a zero will be recorded as the score. It is your responsibility to take the online tests and exam by the due date.

Grading Policy

Visit the “Grades” in Canvas to keep track of your grades. I grade at least once a week and post grades and comments on the online Canvas gradebook. I can tell if you have read the feedback, and will normally comment on missing elements once before I mark an assignment down. If you are missing elements, I will comment and ask for you to resubmit.

SEE NOTES BELOW

If taking Pass/No Pass you need at least 70% of the total class points and complete the final exam to pass the class.

An “F” grade indicates that a student attended, participated and completed the course but failed to master the course curriculum.

An “FW” grade indicates the student stopped attending a course after the “last day to withdraw” deadline and subsequently did not submit any work or participate in any exams. Please check with your counselor and financial aid advisor for possible implications of the FW grade on residency and financial aid status.

Standards of Conduct

Students who register in CCSF classes are required to abide by the CCSF Student Code of Conduct. Violation of the code is basis for referral to the Student Conduct Coordinator or dismissal from class or from the College.

Collaborating on or copying of tests or homework in whole or in part will be considered an act of academic dishonesty and result in a grade of 0 for that test or assignment. I encourage students to share information and ideas, but not their work. See these links on Plagiarism:

Encourage Academic Integrity and Prevent Plagiarism

Citing Information Sources

Accommodations

If you are in need of accommodations, please make me aware of them and contact the Disability Services. The URL to this website is: www.ccsf.edu/dsps.

If you need immediate assistance or need to make an appointment with a DSPS counselor, contact the DSPS main office at:

415-452-5481 (Voice)

415-452-5451 (Telecommunication Device for the Deaf) or use California Relay Service

IT Help

If you're experiencing IT-related issues, such as:

§ Needing a password reset

§ Having computer issues

§ Having printer issues

§ Having AV related issues

§ Having software issues

Contact the Help Desk (24/7/365):

§ By phone: (877) 379-2491

§ By e-mail: helpdesk@ccsf.edu