#!/bin/sh -u # Sample Solution to Exercise #4 # -IAN! idallen@ncf.ca # # Student Name: Eileen Dover # Algonquin EMail Address: abcd0123 # Student Number: 123-456-789 # Course Number: DAT 2330 # Lab Section Number: 019 # Professor Name: Ian Allen # Assignment Name/Number/Date: Exercise #4 due September 24, 2003 # Comments: Sample Solution to Exercise #4 # Create a new subdirectory. (Note the quotes to protect the blank!) # mkdir 'My Dir' # Move into the subdirectory just created. # cd 'My Dir' # Display the current working directory on the screen. # pwd # Sort the Unix password file into a file in the current directory. # sort /etc/passwd >password_sorted.txt # Extract only lines 6-10 from the sorted file into a new file. # head password_sorted.txt | tail -5 >short_password.txt # Append the last five lines of the unsorted file to the new file. # tail -5 password_sorted.txt >>short_password.txt # Display a count of the new file, to show it has the right contents. # wc short_password.txt