Assignment 1 Announcements

Sept 24: Tid bits

Since some of the same questions keep popping up, here are a few answers:

Sept 23: getopt_long

Here's the code for the example used in tutorial: try_getopt_verbose.c".
Sept 17: getenv

The getenv function uses a statically declared character buffer in which to put the value of the environment variable that you passed in as an argument. This means that you may sometimes get odd behaviour if you try to manipulate the pointer that getenv returns or modify the contents of the buffer. The solution is to copy the string to a buffer you have declared.

Also, you should probably follow the instructions in the man page for strtok and not use it. You will then need to write your own code for traversing the character buffer.


Sept 16: Do your experimentation on Linux

Solaris has a version of which that has many fewer options, so you won't get the same behaviour if you try it out on the Sun machines. Log into one of the Linux machines and try it there.

Sept 16: which which

The version of which that is built into tcsh (the default shell on cdf) differs from the man page description. To run the version of which that the man page describes, try running "/usr/bin/which". Alternatively, you could switch to the bash shell temporarily, by typing "bash" (type "exit" to return to your regular shell).


Last modified: Tue Sep 24 17:52:38 EDT 2002