Homework 0: Shell Access
Due: Monday, April 6, at 11:59pm
This assignment lays the foundation for the rest of the course. In it you will demonstrate that you can log into the course Linux system and execute basic shell commands. Students will submit their work via Gradescope, which will automatically check part of the submission. Students are encouraged to resubmit until they earn all 10 available auto-graded points for HW 0. Additional evaluation will check the HW 0 Short Answer document for up to 5 points.
Background & Setup
For this assignment you must use your account on calgary.cs.washington.edu. It is possible to use another reasonably recent Linux system for many things, but we will use the CSE systems to evaluate submitted work, and you need to verify that everything you submit works correctly there. See the Linux Resources page on the course web site for more information about how to get started.
Part 1: Script
- Use your preferred method (see Setup) to connect to
calgary.cs.washington.edu - (Shell) You must be sure that your default shell is
bash. Otherwise you will run into strange, baffling problems with shell scripts. Enter the commandecho $SHELL. The response should be/bin/bash. If the shell name is different (csh,tcsh, or something else), use the appropriate commands on your system to change your login shell tobash. If you do not know how to do this please ask on Ed or attend office hours. - (Commands) In your shell window enter the following commands. They
should work without errors if typed exactly as shown.
cd ~ mkdir cse374 cd cse374 script hw0.script echo $SHELL whoami pwd uname -a gcc --version -std=c11 exit
- (Finishing) If you have done this correctly you will still be
working on Calgary. (You can double check this by running the
uname -ncommand again. This command prints the network name for your current system.) Take a note of where your hw0.script file is stored. (Try using thepwdwhich tells you what your operating directory is.) Then exit back to your home machine usingexit
Notes
The script hw0.script command will capture the terminal session and save it in a file named hw0.script in the current directory. You will stop recording your session when you enter exit. It is useful to think of executing the script command as recording a transcript.
If you consider the above commands you will notice that the first things you have done are moved to your home directory (cd ~), created a new directory (mkdir cse374), and changed your working directory to that new directory(cd cse374). Where is the hw0.script file stored when it is created? What happens if you run these commands more than once?
Part 2: Short Answer
- Create a text document called 'hw0.txt'. You may do this however you want, but, your goal is to create as simple text document, with no formatting. This means you can use a text editor on your home machine, or on Calgary. Or, you can use your favorite word processor, but export the file to a plain text document.
- Put your name and unetid at the top.
- Answer the following questions in your text document:
- What is your preferred name?
- How many late days could you have used on this assignment? Where did you find that information?
- How many summative assessments are there for CSE 374-Spring 2026? What happens if you miss one of the assessments?
- What are two different ways you can ask for help in CSE 374?
- Given this course's guidelines on collaboration, do you think it is okay to use answers directly from an AI tool?
- Save the file and ensure that its name is 'hw0.txt'
Notes
A file extension is the additional part of a file name that comes after the '.' in the name. They are used to communicate the format of the data within the file. In this homework you are creating a file with the extension 'txt', which is a standard way to denote a plain text file. Some programs (particularly Windows programs) use file extensions to determine how to read the files. You can rename files with new file extensions, but, you'll want to be careful that the data encoding within the file matches the file extension.
Submit your homework
Please submit to the Gradescope HW0 assignment. This is linked through Canvas, or you can go directly to Gradescope. You should submit two files, called scp on our linux page.
Grading
This assignment is worth 15 points. 10 points are awarded for completing the script portion - 2 points for each command between echo and gcc --version -std-c11. As this is a foundational assignment you are encouraged to resubmit until you earn a perfect score. An additional 5 points may be awarded during the hand-grading portion based on answers in your HW 0 Write-Up document (one point per question).
Hint: The scriptcommand records everything, even backspaces. If you have too many corrections there will be a lot of extraneous characters if your hw0.script file that may interfere with the autograder. In this case, repeat the exercise carefully avoiding extra key strokes. If you would like to see what is in your script file, use the command cat -A hw0.script.