% CST8207 Assignment 07 -- start-up files, environment, search PATH, quoting, hard and soft links, disk usage % Ian! D. Allen -- -- [www.idallen.com] % Fall 2016 - September to December 2016 - Updated 2017-02-12 03:38 EST - [Course Home Page] - [Course Outline] - [All Weeks] - [Plain Text] Due Date and Deliverables ========================= > **Do not print this assignment on paper!** > > - On paper, you will miss updates, corrections, and hints added to the > online version. > - On paper, you cannot follow any of the [hyperlink URLs] that lead you > to hints and course notes relevant to answering a question. > - On paper, scrolling text boxes will be cut off and not print properly. - **Due Date**: `23h59 (11:59pm) Friday November 4, 2016 (end of Week 9)` - You have more than one week to do this assignment, but your next assignment will be available soon and will overlap this assignment. Start work on this now! Don't delay! - Late assignments or wrong file names may not be marked. Please be accurate and punctual. - **Available online** - Version 1 -- 04:10 October 21, 2016 - **Prerequisites** - All [Class Notes][hyperlink URLs] since the beginning of term. - All your previous [Assignments] and [Worksheets]. - An ability to **READ ALL THE WORDS** to work effectively. - **Deliverables** 1. One plain text file uploaded to Blackboard according to the steps in the [Checking Program] section below. 2. Using [Remote Login] to connect to the [Course Linux Server] (**CLS**), use commands in [The Unix/Linux Shell] to create directory structure and files for marking on the (**CLS**).\ **Do not delete any assignment work from the CLS until after the term is over!** **WARNING:** Some inattentive students upload Assignment #7 into the Assignment #6 upload area. Don't make that mistake! Be exact. Purpose and Background ====================== This is how you are expected to complete this assignment. **Read all the words** before you start working. > **Do not print this assignment on paper!** On paper, you cannot follow any > of the hyperlink URLs that lead you to hints and course notes relevant to > answering a question. This assignment is based on your weekly [Class Notes][All Weeks] and covers these topics: 1. Create your new shell start-up files: `.bash_profile` and `.bashrc` 2. Know the values of key shell environment variables. 3. Work with your shell search `PATH`. 4. Study shell quoting and fix the quoting in a broken shell script. 5. Create hard links and soft (symbolic) links. 6. Examine how hard links work with disk usage. For full marks, follow these directions exactly: 1. **READ ALL THE WORDS** to work effectively and not waste time. 2. Complete the **Tasks** listed below, in order, and don't skip steps. 3. Verify your own work before running the **Checking Program**. (You won't have a checking program at your job interview.) 4. Run the **Checking Program** at the end of the task to help you find errors. 5. Submit the output of the **Checking Program** to Blackboard before the due date, following the directions given below. 6. You will create file system structure in your CLS home directory containing various directories and files. When you are finished the tasks, leave the files and directories in place on the CLS as part of your deliverables. Assignments may be re-marked at any time on the CLS; you must have your term work available on the CLS right until term end. **Do not delete any assignment work until after the term is over!** 7. You can use the **Checking Program** to check your work **after** you have completed each task. Most task sections below require you to **finish the whole task section before running the Checking Program**; you may not always be able to run the **Checking Program** successfully in the middle of a task or after every single task sub-step. The assignment tells you where you can check your work. 8. You can modify your work and check it with the **Checking Program** as often as you like before you submit your final mark. You can submit your mark as many times as you like before the due date. > Since I also do manual marking of student assignments, your final mark may > not be the same as the mark submitted using the current version of the > **Checking Program**. I do not guarantee that any version of the **Checking > Program** will find all the errors in your work. Complete your assignments > according to the specifications, not according to the incomplete set of the > mistakes detected by the **Checking Program**. Searching the course notes on the CLS ------------------------------------- All course notes are available on the Internet and also on the CLS. You can learn about how to read and search these CLS files using the command line on the CLS under the heading *Copies of the CST8207 course notes* near the bottom of the page [Course Linux Server]. The Source Directory ==================== All references to the **Source Directory** below are to the CLS directory `~idallen/cst8207/16f/assignment07/` and that name starts with a *tilde* character `~` followed by a user name with no intervening slash. The leading tilde indicates to the shell that the pathname starts with the HOME directory of the account `idallen` (seven letters). You do not have permission to list the names of all the files in the Source Directory, but you can access any files whose names you already know. Tasks ===== - Do the following tasks in order, from top to bottom. - Have you completed all the prerequisites, before attempting these tasks? - These tasks must be done in your account on the [Course Linux Server]. - **READ ALL THE WORDS!** and do not skip steps. - Run the **Checking Program** to grade your work, then upload the file containing the output of the **Checking Program** to Blackboard. - Your instructor will also mark on the due date the work you do in your account on the CLS. Leave all your work on the CLS and do not modify it. - **Do not delete any assignment work from the CLS until after the course is over.** Set Up -- The Base Directory on the CLS --------------------------------------- > As mentioned in [List of Commands You Should Know], you must keep a list of > command names used each week and write down what each command does. Without > that list to remind you of what command names to use, you will find > assignments very difficult. 1. Do a [Remote Login] to the [Course Linux Server] (**CLS**). **All work in this assignment must be done on the CLS.** 2. Set your `PS1` shell prompt. This is the last time you will have to do this manually; this assignment configures your `.bashrc` file. 3. Create the `assignment07` directory in your usual `Assignments` directory. **Hints:** See your previous assignment for hints on doing the above. **This `assignment07` directory is called the [Base Directory] for most pathnames in this assignment. Store your files and answers in this [Base Directory], not in your HOME directory or anywhere else.** Run the [Checking Program] to verify your work so far. Creating Shell Start-Up Files ----------------------------- You need to understand [Start-Up Files] and how to use a text editor such as [The VI Text Editor] to do this task. ### `.bash_profile` ### `.bashrc` 1. Use a Linux text editor to create your `.bash_profile` and `.bashrc` files with the minimum suggested content described in [Start-Up Files]. These files do not exist yet; you must create them. **Do not set any options or aliases in your `.bashrc` that you do not understand!** If you don't know the meaning of a setting, don't use it. You can RTFM in the `bash` man page for all BASH settings, and RTFM in command man pages to learn about options to commands. Using the `PS1` variable from [Worksheet #2 HTML], set your prompt to include your user name, your computer name, and the basename of your current working directory. Put this setting (or one like it) in your `.bashrc` file. Your `.bash_profile` must contain only one line. Your `.bashrc` must contain at least two lines (not including comment lines). > I will be spot-checking your knowledge of your aliases and shell options. > Students using aliases they don't understand will experience much confusion > trying to do future assignments. Only use aliases and shell options that > you understand. 2. Verify that nothing prints on your screen after you enter your password when you run the non-interactive shell connection using `ssh localhost true` as described in the section on [Non-interactive shells and PS1]: $ ssh localhost true *** COURSE LINUX SERVER *** user@localhost's password: $ For non-interactive commands to work properly, there must be **no** output on your screen after you enter your password using the above non-interactive command line using the `true` command. Your instructor will mark the `.bashrc` and `.bash_profile` files in your account after the assignment due date. Do not upload them to Blackboard. Leave them there on the CLS. Do not delete anything. Run the [Checking Program] to verify your work so far. Using shell environment variables --------------------------------- You need to understand [Shell Variables] to do this task. > Follow correct double-quoting procedures when expanding variables, as noted > in [Shell Variable Quoting]. 1. Make the [Base Directory] your current directory while you work on this task, so that the file you create is in the current directory. (Be lazy: Choose a current directory that makes your pathnames as short as possible!) ### `envilist.sh` 2. Use the `echo` command to display on your screen the value of the environment variable containing your HOME directory. When you have the right command line, put a copy of the command line into file `envilist.sh` in the [Base Directory] (which should be your current directory). (Put a copy of the command line in the file, not the command output.) You may use a text editor such as [The VI Text Editor] to create this file. The file should now contain one command line -- exactly the same command line that you typed to display the value above. If you run the file you created using the shell, it should print your HOME directory: $ sh -u envilist.sh /home/abcd0001 3. Use the `echo` command to display on your screen the value of the environment variable containing your assigned shell. When you have the right command line, append a copy of the command line to the end of the file `envilist.sh` in the [Base Directory]. (Append a copy of the command line to the file, not the command output.) You may use a text editor such as [The VI Text Editor] to edit and add to the end of this file. The file should now contain two command lines. If you run the file using the shell, it should print your HOME directory and your shell. 4. Use the `echo` command to display the value of the environment variable containing your userid. Append the command you use to do this to file `envilist.sh` in the [Base Directory]. (Put in the command, not the output.) The file will contain three command lines and should output three lines when you use the shell to run it. 5. Use the `echo` command to display the value of the environment variable containing your shell search path. Append the command you use to do this to file `envilist.sh` in the [Base Directory]. (Put in the command, not the output.) The file will contain four command lines and should output four lines when run by the shell. 6. Use the `sh` shell to run (execute) your four-line shell script by typing `sh -u envilist.sh` and the values of all four environment variables should display on your screen. (If `envilist.sh` is in some other directory, use the appropriate pathname.) 7. To verify that you have used proper procedures for expanding variables inside your script, set the `HOME` variable to be a GLOB character temporarily and then run the script again like this: $ HOME='*' sh -u envilist.sh Make sure that the first line of script output is the single GLOB character `*` and not a list of file names. If you see a list of file names, re-read all the words in the paragraph about double-quoting at the start of this task, above. 8. Add one or more shell **comment lines** to the end of the file, describing in *your own words* the use for or meaning of each of the four variables in your script. A shell **comment line** starts with a number sign (octothorpe, pound-sign, or hashtag) character "`#`", e.g. # This is a shell comment line. The shell will ignore it. # This is another comment line. It starts with the # character. # Comment lines should be added to the bottom of the file. a) Use your own words (do not copy mine or others) in your comment lines. b) Use as many comment lines as you need to describe all four variables. c) The comment lines should all be on separate lines; do not add comments to the ends of any executable lines in the file. d) Do not put any blank lines in the file (lines with nothing on them). Every line should contain some text. No blank lines. Use a program to count the lines in the file to be sure. Run the [Checking Program] to verify your work so far. Working with your search `PATH` ------------------------------- You must know how to use a [text editor][The VI Text Editor] and understand how a shell uses a [search `PATH`] variable to do this task. You need to know how to [append to a shell variable]. 1. Make the [Base Directory] your current directory while you work on this task, so that the file you create is in the current directory. (Be lazy: Choose a current directory that makes your pathnames as short as possible!) ### `pathswork.sh` 2. Use a [text editor][The VI Text Editor] to create a file named `pathswork.sh` under the [Base Directory] (which should be your current directory). This file will contain these five command lines: 1. The first line must safely `echo` the current value of your search path environment variable onto your screen, as you did above. 2. The second line must set the shell search path variable to include the [Source Directory] for this assignment appended at the (right) end. *Append* the *Source Directory* to the right end of the current search path variable. 3. The third line must safely `echo` the new value of the search path environment variable onto your screen again. 4. The fourth line must be a command line that shows which shell search path directory contains a command named `assignment07check` (the *basename* of the [Checking Program]). This line contains a command name and one argument that must be `assignment07check` 5. The fifth line must have the shell find and execute a command named `assignment07check`, which it will do using the modified search path that you set earlier in the script. No slashes should appear in this command name, so that the shell uses your modified search path to find it and run it. (Review how the [shell search `PATH`][search `PATH`] works.) 3. After you have created your five-line shell script, enable execute permissions on the script file and then run (execute) it using these two command lines: $ chmod u+x pathswork.sh # all lower-case letters $ ./pathswork.sh **Remember how to make a file executable and run it from the current directory; you will need to do this again. Write it down!** When you run the script, each of the five command lines in the script will execute, one after the other. The second line, setting the search path, should produce no output. There will be four outputs that come from the other four lines of the script: 1. The first line of the script will display the current search path. 2. The second line of the script sets a variable and will display no output. 3. The third line of the script will display the modified search path. 4. The fourth line will display the absolute path of where the shell finds the `assignment07check` command name in its modified search path. 5. The fifth line should have the shell find and run the `assignment07check` checking program and generate lots of output. > **Hints:** > > a. You need to know how the shell uses the `PATH` variable to [find and > run commands][search `PATH`]. > b. You need to know how to [append to `PATH`][append to a shell variable]. > c. Remember to [quote all variable expansions][Shell Variable Quoting]. > d. If you see `command not found` output coming from commands inside the > executing script, you have either spelled a command name incorrectly or > have not correctly set the shell search path inside the script file. > This script will only work if the shell search `PATH` is set correctly > near the beginning (top) of the file. > e. The command that tells you which PATH directory contains a command name > is documented in [shell search `PATH`][search `PATH`]. 4. As you did in the previous task, add one or more shell **comment lines** to the end of the file, describing in *your own words* what this script does and how it does it. Use your own words (do not copy mine) in your comment lines. Use as many comment lines as you need to describe the script. Run the [Checking Program] to verify your work so far. Quoting Exercise -- Easy Version -------------------------------- You must know how to use a [text editor][The VI Text Editor] and understand how shells use [Quoting] to do this task. Remember to read the **Hints** below. 1. Make the [Base Directory] your current directory while you work on this task, so that the files you create are in the current directory. (Be lazy: Choose a current directory that makes your pathnames as short as possible!) ### `quotefix.sh` 2. Copy the script file `badquotes.sh` from the [Source Directory] into the current directory using the new name `quotefix.sh` as you copy it. 3. Enable execute permissions on the script file and run the script (as you did in the previous task). Note that the output of running the script generates an error message at the bottom, and the lines output on the screen don't match what is written in the script file. For example: many quotes are missing, GLOB characters and variables are expanding, and the spacing of the words is different. 4. Use a text editor to add [Quoting] inside the script file so that the text given to `echo` on each line is fully quoted to be one single argument to each `echo` command, and the text must display on your screen exactly as written in the file, blanks included, with no meta-character expansion by the shell. The correct ten lines of output should look *exactly* like this when you are finished, including all the extra spaces between some of the words: Where is the missing question mark after the file name /etc/passwd? Is the question mark also missing after the file name /etc/group? Do you see any *[square]* *[brackets]* in this line ???????????? The Bash shell prompt is contained in the upper-case $PS1 variable. This line isn't appearing on my screen accurately. It's missing the quotes. This line is also "missing all" the quotes. It "is not right" yet. This line is also "missing quotes". It's output doesn't make sense. The shell gives an error message on this line. It isn't working either. *** This file is to practice shell quoting. Do you see this line? *** Do you see this last line with all the extra spaces ? The correct script output (above) is exactly ten lines, 118 words, 707 characters and has a checksum of `19049 1`. > **Hints:** > > A. You must edit the `quotefix.sh` file to make the entire line of text on > each line *one* single shell argument to `echo`. Review how the shell > finds [arguments] and how to use [Quoting] to hide shell > metacharacters. > > B. You can check whether you have successfully created one single argument > on each line by using an alias to temporarily substitute the > [`argv.sh`] program from the [Class Notes][All Weeks] for the `echo` > command. > > You can easily get a copy of the `argv.sh` program from the course > notes on the CLS using the `newnotes` symbolic link you created in a > previous assignment. > > Read the comments inside the `quotefix.sh` file for details on using an > alias to run `argv.sh`. You have to put the `argv.sh` program into the > same directory as `quotefix.sh` under the name `argv.sh` and make it > executable. > > C. If your line and word count is correct but the number of characters is > less, you probably failed to make the entire text *one* > [argument][arguments] to `echo` on each line. You must use [Quoting] to > hide *all* the blanks and special characters from the shell on each of > the lines. The [`argv.sh`] program will tell you if you got it right. > > D. If your output is mostly correct but you can't find your mistakes, copy > the above correct text into a file `foo` on the CLS, run your script > and save the script output in file `bar`, then use the `diff` command > to compare the two files and show you just the lines where the > differences are. In the course notes you can [learn about how to use > diff]. ### `quotefix.txt` 5. When the output of your edited script is correct, run the script and redirect the script output into file `quotefix.txt` in your [Base Directory] (which should still be your current directory). The file must contain exactly the same lines, words, and characters as given above. The checksum of the file must be the same as above. **Hint:** Make sure you spell the extension on the pathname correctly. Run the [Checking Program] to verify your work so far. Symlink to the Checking Program ------------------------------- You need to understand [Symbolic Links] to do this task. ### `check` 1. Create a symbolic link named `check` in your [Base Directory] that links to the [Checking Program] in the [Source Directory]. Instead of typing the huge absolute pathname when you want to run the [Checking Program], all you need to type is the short name of this symlink, which now points to the long pathname. When in your [Base Directory] you can use your symbolic link `./check` to run [Checking Program] to verify your work so far. > You already created symbolic links to `oldnotes` and `newnotes` in a > previous assignment. These (shorter) symbolic links let you access the > course notes using much shorter pathnames. Sysadmin often create (shorter) > symbolic links to long pathnames that they use frequently. Hard and Soft Linking exercise ------------------------------ You need to understand [Hard Links] and [Symbolic Links] and to do this task. ### `link1dir/`*abcd0001*`.txt` 1. In your [Base Directory], create a sub-directory and an empty file `link1dir/`*abcd0001*`.txt` (no spaces), where the text *abcd0001* is replaced by your *own* eight-character userid in the file name. **NOTE:** The sub-directory name is `link1dir` (seven letters and one digit). 2. For every unique character in your own eight-character userid, create a sub-sub-directory under `link1dir` with that single-character name. For example, the userid *abca0151* would result in six unique sub-sub-directory names under the `link1dir` directory -- one sub-sub-directory for each of the unique characters `a`, `b`, `c`, `0`, `1`, `5`. Each new directory must be directly under the `link1dir` directory. *(Note: You can create multiple directories with one single command line.)* Do this for your *own* userid, which means you may have more or fewer sub-sub-directories, depending on the letters and digits in your own userid. 3. Inside each of those new sub-sub-directories, create a single [Hard Link] to the empty file from the first step. Keep the same file name as the original for each hard link you create. Use hard links, not symbolic links. Continuing the above example, the *abca0151* user would hard link the original empty file name *abca0151.txt* into each of those six new sub-sub-directories, creating six additional names for the same file. Keep the same file name as the original for each hard link. Check the link counts on everything to make sure that you have created links to the same file and not made copies of the file. Use hard links, not symbolic links. 4. For every lower-case letter directory name you created, create a short, relative [Symbolic Link][Symbolic Links] that is its upper-case equivalent. If you created directory `a`, then create symlink `A` that points to (has a target of) `a` so that both `ls link1dir/a` and `ls link1dir/A` give identical results. (You must use symbolic links, because you cannot make hard links to directories.) 5. In every file you have just created in this section, enter the following information, one name per line: Enter the names of the three common file system commands that are "directory only" commands that require permission only on the directory inode to work properly, and that do *not* require permissions on the file inode to work. The answer is three lines, one command name per line. (See your in-class notes for the three names I wrote on the board, or read the course notes about links and inodes.) The right answer has a word count of `3 3 9`. > **Hints:** All the file names you created in this section should be hard > links to the same file; you have very little editing to do. The three > command names are all commands that are [directory operations][Hard Links] > that manipulate file names; they don't touch the file data and don't need > any permissions on the file data. Use your symbolic link `./check` (created in the previous task) to run [Checking Program] to verify your work so far. Four Disk Usage Exercises: easy, medium, hard, ug1y --------------------------------------------------- You need to understand [Hard Links] and [Disk Usage] to do this task. **Read this task all the way through, especially the *Hints*, before you delete anything, or else you will have to start over again.** For the next task, you will need to look up the copy option that means *archive* that preserves hard links (as well as all the other attributes) when you copy a directory (RTFM). ### `My Disk Use` 1. After you have run the [Checking Program] at least once, you will find created for you in the [Source Directory] a disk usage directory named `DiskUse/`*abcd0001* (where *abcd0001* is replaced by *your own userid*). Copy, using the *archive* option, this directory into your [Base Directory] using the name `My Disk Use`. Do not create the `My Disk Use` directory before you do the *archive* copy or else you will create an extra level of directory. You will know you got it right if your personal copy of the `My Disk Use` directory has the same disk use summary (`du -s`) as the one in the [Source Directory] and there must be a sub-directory named `My Disk Use/e/foo` with two hard-linked file names in it. In your personal `My Disk Use` directory, some of the files are hard links to each other. (If there are no hard links anywhere, you didn't use the *archive* option to the copy command that preserves hard links. Delete everything and re-copy.) Your personal copy of the `My Disk Use` directory contains almost three dozen sub-directories, each of which may contain one or more files and further sub-sub-directories. (If you don't see almost three dozen sub-directories under your copy of `My Disk Use`, read all the words in the **Hints** again.) A recursive list of pathnames under `My Disk Use` counts 364 names. There are four levels of difficulty in this task, one for each of four specially-named sub-directories in your personal `My Disk Use` directory. Do the **easy** level first, followed by the **medium** level, followed by the **hard** level, followed by the **ug1y** level. **Read this task all the way through, especially the *Hints*, before you delete anything, or else you will have to start over again.** ### The easy level and the three steps A B C Locate the sub-directory of your personal `My Disk Use` directory that contains the text `easy` in the name. Make this your current directory and then follow steps **A** through **C** below: A. Under the current directory, there is a directory named `foo`. B. Reclaim all the disk space used by the files under `foo` by removing all the files under `foo` and any hard links to those files. Some of those hard links may be to files in other sub-directories under the current directory; you don't have to scan the whole file system to find the hard links. Read the **Hints** carefully before you remove anything. C. Run the [Checking Program] to verify your work so far. See the **Hints** if you need to start over. ### The medium level Locate the sub-directory of your personal `My Disk Use` directory that contains the text `medium` in the name. Make this your current directory. Repeat the steps **A** through **C** above. ### The hard level Locate the sub-directory of your personal `My Disk Use` directory that contains the text `hard` in the name. Make this your current directory. Repeat the steps **A** through **C** above. ### The ug1y level Locate the sub-directory of your personal `My Disk Use` directory that contains the text `ug1y` in the name. (Note carefully the strange spelling, which is *not* the same as `ugly`.) Make this your current directory. Repeat the steps **A** through **C** above. ### Hints for each level: easy, medium, hard, ug1y > ``{=html}**Hints:** The current directory must be set as given above > for each level.``{=html} > > 1. **Do not remove any names from `foo` until you also know how to find > and remove all the other names for these files.** Once you have removed > all the files from `foo`, it is too late to try to find out which other > names were hard links to the files in `foo`. > > 2. One or more of the files in the `foo` subdirectory have more than one > name. Some of those other names may be located in other subdirectories > somewhere under the current level. (You don't have to search the whole > disk partition to find them.) The disk blocks for these files in `foo` > will not be freed until you find and remove *all* their names. You may > need to look at inode numbers to know which files in directory `foo` > are also named in the other directories. You read about how to do this > in [Disk Usage]. > > 3. Options to `ls` to display hidden names and nongraphic (unprintable) > characters will be needed for the harder sections (RTFM). Many names > will need to be quoted to hide shell metacharacters (see [Quoting]). > > 4. If you don't get the right answer for a difficulty level, you can start > over by re-copying all or part of your `My Disk Use` directory > from where you originally got it in the [Source Directory]. > > If you make errors in this task and need to redo one of the four > sections, you can remove and re-copy from the [Source Directory] just > the sub-directory for that one section. You don't have to remove and > re-copy the whole `DiskUse/`*abcd0001* > directory, since that would lose the work you did on the other > sections. > > If you do want to remove your entire personal `My Disk Use` > directory to start over, you will need to redo all four levels. If you > are smart and rename the directory instead of removing it, you can > salvage from the saved directory the parts of the task you have already > done successfully, so you won't have to redo those parts. > > 5. If you find that you don't own any of the files under your > `My Disk Use` directory, and that you have no permission to > remove any files, then you didn't **copy** the files correctly. Delete > everything and re-read and re-do that first step. > > 6. **Do not remove any names from `foo` until you also know how to find > and remove all the other names for these files.** Once you have removed > all the files from `foo`, it is too late to try to find out which other > names were hard links to the files in `foo`. When you are done ----------------- That is all the tasks you need to do. Check your work a final time using the [Checking Program] below and save the standard output of that program into a file as described below. Submit that file (and only that one file) to Blackboard following the directions below. When you are done, log out of the CLS before you close your laptop or close the PuTTY window, by using the shell `exit` command: $ exit Checking, Marking, and Submitting your Work =========================================== **Summary:** Do some tasks, then run the **Checking Program** to verify your work as you go. You can run the **Checking Program** as often as you want. When you have the best mark, upload the single file that is the output of the **Checking Program** to Blackboard. > Since I also do manual marking of student assignments, your final mark may > not be the same as the mark submitted using the current version of the > **Checking Program**. I do not guarantee that any version of the **Checking > Program** will find all the errors in your work. Complete your assignments > according to the specifications, not according to the incomplete set of the > mistakes detected by the **Checking Program**. 1. There is a **Checking Program** named `assignment07check` in the [Source Directory] on the CLS. You can execute this program by typing its (long) pathname into the shell as a command name: $ ~idallen/cst8207/16f/assignment07/assignment07check You learn one way to make this shorter in the current assignment. 2. When you are done, execute the above **Checking Program** as a command line on the CLS. This program will check your work, assign you a mark, and display the output on your screen. You may run the **Checking Program** as many times as you wish, allowing you to correct mistakes and get the best mark. **Some task sections require you to finish the whole section before running the *Checking Program* at the end; you may not always be able to run the *Checking Program* successfully after every single task step.** 3. When you are done with this assignment, and you like the mark displayed on your screen by the **Checking Program**, you must **redirect** only the standard output of the **Checking Program** into the text file `assignment07.txt` in your [Base Directory] on the CLS, like this: $ ~idallen/cst8207/16f/assignment07/assignment07check >assignment07.txt $ less assignment07.txt - Use standard output redirection with that *exact* `assignment07.txt` file name. - Use that *exact* name. Case (upper/lower case letters) matters. - Be absolutely accurate, as if your marks depended on it. - Do not edit the output file; the format is fixed. - Make sure the file actually contains the output of the **Checking Program**! - The file should contain, near the bottom, a line starting with: `YOUR MARK for` - Really! **MAKE SURE THE FILE HAS YOUR MARKS IN IT!** 4. Transfer the above single file `assignment07.txt` (containing the output from the **Checking Program**) from the CLS to your local computer. - You may want to refer to the [File Transfer] page for how to transfer the file. - Verify that the file still contains all the output from the **Checking Program**. - Do not edit or open and save this file on your local computer! Edited or damaged files will not be marked. Submit the file exactly as given. - The file should contain, near the bottom, a line starting with: `YOUR MARK for` - Really! **MAKE SURE THE FILE YOU UPLOAD HAS YOUR MARKS IN IT!** 5. Upload the `assignment07.txt` file from your local computer to the correct Assignment area on Blackboard (with the exact name) before the due date: 1. On your local computer use a web browser to log in to Blackboard and go to the Blackboard page for this course. 2. Go to the Blackboard *Assignments* area for the course, in the left side-bar menu, and find the current assignment. 3. Under *Assignments*, click on the underlined **assignment07** link for this assignment. a) If this is your first upload, the *Upload Assignment* page will open directly; skip the next sentence. b) If you have already uploaded previously, the *Review Submission History* page will be open and you must use the *Start New* button at the bottom of the page to get to the *Upload Assignment* page. 4. On the *Upload Assignment* page, scroll down and beside *Attach File* use *Browse My Computer* to find and attach your `assignment07.txt` file from your local computer. Make sure the assignment file has the correct name on your local computer before you attach it. Attach *only* your `assignment07.txt` file for upload. Do not attach any other file names. 5. After you have attached the `assignment07.txt` file on the *Upload Assignment* page, scroll down to the bottom of the page and use the *Submit* button to actually upload your attached `assignment07.txt` file to Blackboard. 6. Submit the file exactly as uploaded from the CLS. 7. Do not submit an empty file. Do not submit any other file names. Use only *Attach File, Browse My Computer* on the *Upload Assignment* page. Do not enter any text into the *Write Submission* or *Add Comments* boxes on Blackboard; I do not read them. Use only the *Attach File, Browse My Computer* section followed by the *Submit* button. If you need to comment on any assignment submission, send me [EMail]. You can revise and upload the file more than once using the *Start New* button on the *Review Submission History* page to open a new *Upload Assignment* page. I only look at the most recent submission. You must upload the file with the correct name from your local computer; you cannot correct the name as you upload it to Blackboard. 6. **Verify that Blackboard has received your submission**: After using the *Submit* button, you will see a page titled *Review Submission History* that will show all your uploaded submissions for this assignment. Each of your submissions is called an *Attempt* on this page. A drop-down list of all your attempts is available. a) Verify that your latest *Attempt* has the correct 16-character, lower-case file name under the *SUBMISSION* heading. b) The one file name must be the *only* thing under the *SUBMISSION* heading. Only the one file name is allowed. c) No *COMMENTS* heading should be visible on the page. Do not enter any comments when you upload an assignment. d) Click on the *Download* button to open and view the file you just uploaded. **MAKE SURE THE FILE YOU JUST UPLOADED HAS YOUR MARKS IN IT!** e) **Save a screen capture** of the *Review Submission History* page on your local computer, showing the single uploaded file name listed under *SUBMISSION*. If you want to claim that you uploaded the file and Blackboard lost it, you will need this screen capture to prove that you actually uploaded the file. (To date, Blackboard has never lost an uploaded file.) f) Make sure you have used *Submit* and not *Save as Draft*. I cannot mark draft assignments. Make sure you *Submit*. You will also see the *Review Submission History* page any time you already have an assignment attempt uploaded and you click on the underlined **assignment07** link. You can use the *Start New* button on this page to re-upload your assignment as many times as you like. You cannot delete an assignment attempt, but you can always upload a new version. I only mark the latest version. 7. Your instructor may also mark files in your directory in your CLS account after the due date. Leave everything there on the CLS. **Do not delete any assignment work from the CLS until after the term is over!** - I do not accept any assignment submissions by EMail. Use only the Blackboard *Attach File, Browse My Computer*. No word processor documents. Plain Text only. - Use the *exact* file name given above. Upload only one single file of Linux-format plain text, not HTML, not RTF, not MSWord. No fonts, no word-processing. Linux plain text only. - **NO EMAIL, WORD PROCESSOR, PDF, RTF, or HTML DOCUMENTS ACCEPTED.** - No marks are awarded for submitting under the wrong assignment number or for using the wrong file name. Use the exact 16-character, lower-case name given above. - **WARNING:** Some inattentive students don't read all these words. Don't make that mistake! Be exact. **READ ALL THE WORDS. OH PLEASE, PLEASE, PLEASE READ ALL THE WORDS!** -- | Ian! D. Allen, BA, MMath - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/ [Plain Text] - plain text version of this page in [Pandoc Markdown] format [www.idallen.com]: http://www.idallen.com/ [Course Home Page]: .. [Course Outline]: course_outline.pdf [All Weeks]: indexcgi.cgi [Plain Text]: assignment07.txt [hyperlink URLs]: indexcgi.cgi#Important_Notes__alphabetical_order_ [Assignments]: indexcgi.cgi#Assignments [Worksheets]: indexcgi.cgi#Worksheets__not_for_hand_in_ [Checking Program]: #checking-marking-and-submitting-your-work [Remote Login]: 110_remote_login.html [Course Linux Server]: 070_course_linux_server.html [The Unix/Linux Shell]: 120_shell_basics.html [List of Commands You Should Know]: 900_unix_command_list.html [Base Directory]: #set-up-the-base-directory-on-the-cls [Start-Up Files]: 350_startup_files.html [The VI Text Editor]: 300_vi_text_editor.html [Worksheet #2 HTML]: worksheet02.html [Non-interactive shells and PS1]: 350_startup_files.html#non-interactive-shells-and-ps1 [Shell Variables]: 320_shell_variables.html [Shell Variable Quoting]: 320_shell_variables.html#double-quote-all-uses-of-variables [search `PATH`]: 400_search_path.html [append to a shell variable]: 320_shell_variables.html#appending-to-a-variable [Source Directory]: #the-source-directory [Quoting]: 440_quotes.html [arguments]: 150_arguments_and_options.html [`argv.sh`]: 440_quotes.html#using-argv.sh-to-count-command-line-arguments [learn about how to use diff]: 525_tar_gzip_diff.html [Symbolic Links]: 460_symbolic_links.html [Hard Links]: 455_links_and_inodes.html [Hard Link]: 450_file_system.html [Disk Usage]: 457_disk_usage.html [File Transfer]: 015_file_transfer.html [EMail]: mailto:idallen@idallen.ca [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/