Tools: the work on Unix server machines is done by
connecting to them remotely. This department offers two servers to
connect: neptune.cs.kent.edu
and poseidon.cs.kent.edu. You can use either. There are
two common programs (clients) to connect to the
server: ssh or putty. Both are available
from the start-menu of the lab machines. You can use either. The
client provides a command-line interface to the servers. A program
that interprets your command, called shell, presents a
prompt similar to signifying that it is
ready to accept your commands. In Unix, files are organized into
directories (folders) which may contain subdirectories
(subfolders). The shell keeps track of the current working
directory to which default commands such as copy or create
subdirectory apply. A useful command is ls that lists all
the files and subdirectories of the current working directory. The
navigation along the directory tree is done using cd
command that changes the current working directory. The creation of
files and subdirectories is done through command-line interface. See
a quick guide to Unix commands below.
Once connected you need to use an editor to input you program, use the
g++ to compile it, document your actions, then use subversion to
submit it.
- Inputting your program: There are two most commonly used Unix
editors emacs and
vi (or vim, which is an extended version
of vi). You can use either of them.
- Compiling your program: You need to input the command to
compile your program at shell prompt. Below command compiles a c++
file exceptions.cpp and produces an
executable exceptions:
g++ -o exceptions exceptions.cpp
If the compiler outputs errors, you need to use the editor to remove
them. If the program compiles successfully, you can execute it by
typing the name of the executable at the prompt.
- Documenting your actions: Unix command script
presents a new prompt and then records everything that is input or
output to the screen in a file called typescript
Program script stops the recording after
command exit is executed.
To prove that you used Unix tools, as part of your project
submission, you need to submit typescript file with the
record of at least one successful compilation of your program (the
execution of the compiler on your source code file).
- Using subversion: Subversion has a Unix command-line
interface that can be used to submit your program. The command to
invoke subversion is svn. In particular, you need to
check out your project directory tree from the repository, add the
directory for the new project to the local copy of the tree, inform
subversion that new files are under subversion control and then commit
the changes back to the subversion repository. The sequence of
commands is as follows:
- svn checkout http://classes.cs.kent.edu/courses/cs23021/svn/SECTION/USERID
this creates a directory USERID with subdirectories for all your projects.
- mkdir USERID/Lab13_Exceptions
creates a new subdirectory for the new lab.
- cp exceptions.cpp typescript USERID/LAB13_Exceptions
copies the files from the current working directory to the new lab directory
- svn add USERID/Lab13_Exceptions/
informs subversion that the new directory and all the files there are under
its control
- svn commit USERID/ -m "committing the Exceptions
lab"
stores the new files into the subversion
repository. The last option (after -m) is an arbitrary
string.
Refer to the below quick reference guides for unix, editor, and
subversion commands.
Unix Tools Reference Guides