CS010 Practice 11 and 12
Unix tools, Customizing X, shell scripts, C file I/O, and more
- Use grep to find all the calls to strcmp in your C files.
- Use the command above but this time pipe the output to another
command to allow you to determine approximately how many times you
call strcmp.
- Create an xclock with Williams colors. (Hint: you will need to
look at the man page for xclock to figure out how to change the
color of the clock hands.)
- Change your X window root to a different color or to a
background image (on the systems in TCL 312).
- Add an entry to the menu that comes up when you click on the
middle mouse button in the root. The new entry should start a
program called xfig. xfig allows you to draw figures.
- Try the KDE window manager on the Unix systems in TCL 312.
This is a much more advanced X interface than the default one we've
been using. Many Windows or Macintosh users prefer this interface.
Notice that it looks completely different and often behaves much
differently than the simple interface. Why is this good? Why is
this bad?
- Modify your hangman program to read its list of words from a
text file specified on the command line. Do the same for the spell
checker, reading the list of words for the dictionary from a text
file. In each case, make the first line of the text file the
number of words, and then list one word per line. Can you use the
same functions for both of these? If so, make one C file and one
header file which reads the files, and use the same code in both
programs.
- Write a shell script that creates a list of all files in a
directory and sorts them from largest to smallest. The output
should be a list of files and their sizes, in that order. Start
with the output of ls -l and use other Unix tools to
reformat and sort the output.