Introduction to Database Systems
UNIX Potluck
Assignment #2
Due January 24th
Basic
- At the prompt type in a command that will display the middle 10 lines
of a 30 line program.
- Use Awk to print
- the longest line in a file
- the shortest line
- the one that contains the most spaces
- the 10th line
- the total number of input lines
- the entire file with the first record on each line replaced by the line
number
- the entire file with the first two records reversed
Hint: you probably want to generate some test files for these.
For
f and g, you probably want to build a formatted file where records are
separated by tabs
- List the sequence of characters (starting at a shell prompt) that
yields a text file containing only the word "yams"
- using vi
- using emacs
- using pico
Which editor took the most keystrokes?
- Using the find command, print out all the files that are beneath the /usr
directory that contain the word "mail" in them. Do it again but this
time only show the files that have been changed this year.
Super User
- Write a script or command line sequence of piped commands (e.g. cat,
tr, sort,
uniq, and head) to display the 25 most common words in all the files in a
directory.
- Using Awk (and/or other Unix tools) output a list of people that have
sent you
mail arranged in order of total number of messages sent. (Hint: use the
commands "from" and "cut." You may also need others...)
- Design a web page that returns the current time. (Use CGI
programming and
Perl -- or other language)
Wizard
- Implement the current time assignment (from above) that displays the
time in
a graphical way.
( this might not be so
easy!)
- Make a script that goes text files and prints each sentence on its
own line.
|