IT 244: Introduction to Linux/Unix
Homework 3

Due Sunday, February 11th at 11:59 PM

Deliverables

All this work should be done on users3.cs.umb.edu.
  1. A .plan file in your home directory

  2. A shell script named hw3.sh that performs the operations listed below.
    This file should be in an hw3 directory inside your hw directory inside your it244 directory.
    See this document for instructions on creating this script.

Details

.plan

Go to your home directory and create a text file with the name.plan.
Put some information about yourself in this file.
The text in this file will be printed to the terminal when finger is run on your Unix ID or name.
Use nano or any other Unix text editor to create this file.

20 points

The shell script named hw3.sh

Create an hw3 directory in your hw directory inside your it244 directory.

Go to this hw3 directory.

Run Unix commands that will execute the steps below.

When you have a command line that does what the step asks you to do, copy it from the command line and paste it into hw3.sh using nano or any other text editor.

When you have completed all the steps, create an echo statement before the commands for each step, that will print the step number to the terminal.

Make sure that your script meets all of the requirements mentioned here.



80 points
  1. Print to the terminal the contents of the file red_sox.txt in /home/tsoro/course_files/it244_files
  2. Using grep and pipes, | , select all the Red Sox away games where they won, except for the games they played against the Orioles
    Away games are indicated by the @ symbol
  3. Select all the Red Sox away games where they won, except for the games they played against the Orioles, sorted by date in reverse order
  4. Print the contents of the file foo.txt in /home/tsoro/course_files/it244_files to the terminal
  5. Print to the terminal the contents of foo.txt, selecting only those lines with the word "foo" as a whole word
    In other words, "foo" must NOT appear as part of another string, like "foobbbbbbbb".
    There is an option for grep that tells it to only match the string when it appears as a word, not as part of a bigger string
    Check the man page for grep to find this option
    Don't call the man page from within your shell script.
  6. Print to the terminal the lines in foo.txt that have the string ### in them
  7. Print the contents of the file numbers1.txt in /home/tsoro/course_files/it244_files to the terminal
  8. Use head and tail to print to the terminal lines 6 through 13 in numbers1.txt
  9. Use sort to print to the terminal the contents of numbers1.txt in reverse numerical order
  10. Use diff to print to the terminal the differences between numbers1.txt and numbers2.txt in a human readable format
  11. Print to the terminal the name of the host to which you are connected
  12. Consult the man page for date, then use this command to print to the terminal the date in the format yyyy-mm-dd.
    Don't call the man page from within your shell script.
  13. Print to the terminal the location of the executable file for perl, a scripting language. The command you use should only work for executable files
  14. Find all files that have the string "nano" in their filename
  15. List all the users currently logged in to users3
  16. Run finger on your Unix username to print to the terminal the information you entered in your .plan file