Homework
2
(due Friday, February 22, 2002)
(worth 50 points only)
IMPORTANT: This assignment must be submitted using WebCT.
Late assignments will not be accepted by the system. I highly recommend
you submit your assignment before the
due date, rather than waiting until the last minute. I will not accept
written or e-mailed homeworks.
In this problem, you will take you in a quick tour through some of UNIX's
simple commands. The solution to this problem is the script file typescript
(see below).
From the UNIX command prompt on CSA, do the following:
-
Type script to begin a script file.
-
Type date and date -u
-
Then display the calendar for the month you were born by typing cal
M YYYY where M is the number of the month and YYYY is
the year.
-
Type webster zouave to find out the definition of zouave.
Using the "wildcard" character %, type webster z%%%%e to
find out how many other six letter words webster knows that start with
z
and end with e.
-
Use calc to perform at least two calculations.
-
Find out my email address by typing ph stephen crampton. Now find
out your own email address. (You can do this with any person who has an
account at BU.) Type the letter q to exit the ph program.
-
Print out the name of your home directory by just typing pwd (print
working directory).
-
Create a new directory called hw1 Move all of your files from
Homework 1 into that directory.
-
Change directories so that you are in the new hw1 directory.
Create a new subdirectory; call it csv-files Using the wildcard
character (*), move all of the .csv files into the csv-files
directory using one command.
-
List the contents of the hw1 directory using the ls command
with -l option.
-
Do the same for the csv-files directory.
-
Create a new file containing the output of the cal program by typing
cal
> newfile This will dump the characters that were normally output on
the screen by cal into the file called newfile.
-
Show the contents of the file by typing more newfile
-
Copy this file to another file by typing cp newfile newfile2
-
List the contents of your directory using both the ls and ls
-l commands.
-
Remove the files newfile and newfile2 by typing rm newfile
and then rm newfile2
-
Type exit to terminate the script program. The script will be stored
in a file called typescript in your current directory.
-
Submit the file typescript to "Homework 2" under WebCT.