Appendix A

OpenWindows, UNIX, Utilities

A.1 login and logout

Every time you use the computer system, it is necessary to identify yourself. This process is known as logging in to your account. To log in, you must first enter your account name after the login: prompt, then your personal password after the password: prompt. For security reasons, unlike your account name, your password will not appear on the screen as you type it.

At the end of a work session it is necessary to log out. When you want to finish working on the computer, always use the menu item Exit in the Workspace menu. Afterwards, when OpenWindows has closed down, it is necessary to enter the logout command. This closes your account and frees up the machine for other users.

A.2 OpenWindows

OpenWindows' desktop environment is installed on the machines used in this course. Each time you log in, the desktop program OpenWindows is automatically started. The blue background represents a desktop or work space, upon which different sorts of elements are made available, such as: windows, icons and menus. The following is an example of a desktop:

A.2.1 Windows

Applications running on the computer are located in windows. At the left side of the default environment pictured above there are three windows:

The console is in the upper left corner of the screen. The system uses this window to write system related messages about the actions taking place on the computer. If there is a problem with a program, look in the console for an error message.

The File Manager is located just below the console. It contains a graphical representation of all the files and folders in your account and on the system. It operates similar to a Macintosh desktop.

A command tool is opened by default in the lower left corner of the screen. Executable command can be entered from the keyboard. AutoCAD must be started from a command tool and UNIX-commands, such as those for copying, renaming or deleting files (see tutorial UNIX) can be executed in a command tool as well.

A.2.2 Icons

If you close a window, by pressing the button in the top left corner of the window's frame, it collapses into an icon. Icons also represent on going processes or tasks on your machine. Different programs have different icons. On the sample screen illustrated above, there are icons for the following processes and tools: wastebasket, mail tool, snapshot tool, clock and others. Double clicking an icon, with the left mouse button, reopens the window.

A.2.3 Mouse Operations

Since it is possible to have many windows open at the same time, the computer needs to know where you want to direct a command or a mouse click. This is done by moving the mouse so that the pointer (or cursor) is located on the desired icon, tile bar, background or window (this may change the shape of the pointer).

The mouse has three buttons, each of which performs a different sort of task. The left mouse button is used the most. It places the writing mark, moves and resizes windows, moves the slides of scroll bars and selects individual items in a dialogue box. The middle button is used for multiple selection. The right button of the mouse calls menus.

A.2.4 Menus

A menu contains a list of commands that can be performed by a specific application. There are two sorts of menus available in OpenWindows: Pull-down menus and pop-up menus.

Some application windows have buttons below the title bar with names and/or arrows on them. These are pull-down menus that open when you place the pointer on them and press the right button of the mouse. By moving the cursor to the desired command name and pressing the right mouse button again, you can invoke any of the commands that appear on the list.

The other available menus are pop-up menus. These menus 'pop up' whenever you press the right button of the mouse on the free space inside a window or on the frame of a window. The menus that appear belong to the application that is running in the window. There is a pop-up menu for the desktop as well. It is called by clicking the right mouse button while the cursor is on the blue background of the desktop. Many desktop applications like command tools, text editors, mail tools and the exit function are located in the workspace pop-menu. The following is an illustration of the workspace pop-up menu.

2.5 Text Editor

In order to write programs, you will need to use the Text Editor to produce text files. Open a text editor from the desktop pop-up menu by keeping the right mouse button pressed and moving it to the right of the Programs option, move the cursor to the Text Editor... option in the submenu that appears and let the mouse button go. A text editor can also be opened by entering textedit in a command tool. Both methods should display the following window:

The File menu, shown in the following figure, contains the necessary menu items for loading and saving your text files. When you select one of these items a pop-up window will appear, in which the location (Directory) and the name of the file can be entered or changed before the command is carried out.

There are many other functions in the Text Editor that allow one to, among other things, find and replace parts of a text, copy, cut and paste. Especially interesting for programming with LISP is the function Find Marked Text in the Find menu. This function allows one to quickly locate pairs of parentheses. 


The machines available in this course run under UNIX operating system (OpenWindows windowing environment operates on top of the operating system). An operating system lets you or the programs that you run interface with various input, output and storage devices and makes them work together by controlling and scheduling various processes. One of the tasks of operating systems is to maintain and manage a file system.

A.3.1 File System

Conceptually, a file system is a place where various kinds of information that you can access or that you create is stored in logical units called files. Under UNIX, a tree structured file system is available.

At the top of the tree is a place called root directory- whenever you log in, you are at the root level or directory of your account. A directory can be thought of as a folder that may contain a number of files or other directories- called subdirectories (inside which may be yet other files or subdirectories, and so on).

Each directory and subdirectory has a name, and similarly each file also has a name. UNIX is case-sensitive, i.e. file1 and File1 are not the same.

As you work through various programs and commands, you will notice that some files have special extensions, i.e. a period (.) followed by some characters. For example, test.lsp is a file with an extension .lsp (which is what your program should have).

There are some conventions regarding these extensions and their meanings are as follows:

.lsp a Lisp program file
.dwg an AutoCad drawing file
.bak a backup file of an original that was recently edited

A.3.2 UNIX Commands

In the following, a small set of most useful UNIX commands are explained. Any of these commands can be entered in a command tool window.

Displays present working directory, i.e. where you are in reference to the file system tree.
Displays contents of current directory, all the files and subdirectories. On your system, this command may display backslash (/) character after some names; this signifies each of those names is a directory.
ls -a
Displays complete contents of the current directory including what are known as dot files which are usually not displayed (files that have a period as the first character in their names).
ls dir1
Displays the contents of a directory named dir1 (note: dir1 should exist at the same level as pwd, or a complete directory path is needed, see below).
mkdir name
Creates a new subdirectory called name.
Changes current working directory to the root directory.
cd ..
Changes current working directory to the parent directory, i.e. one level up in the file system tree.
cd dir1
Changes current working directory to the one called dir1 (note: dir1 should exist at the same level as pwd, or a complete directory path is needed).
cd dir1/dir2
Changes current working directory to dir2 which is stored in directory dir1 (note: dir1 should exist at the same level as pwd). This is called a directory path specification and can be thought of as giving directions for going from one branch on the tree to another branch.
cp file1 file2
Copies contents of file1 and stores it under another file named file2 (the original file remains unaffected).
mv file1 file2
Moves the contents of a file stored as file1 to another file named file2 and deletes file1.
mv dir1/file1 dir2/file1
Moves the file named file1 under directory dir1 to another file named file1 stored in directory dir2.
mv dir1 dir2
Moves the entire directory dir1 (and all the files stored under it) to another directory named dir2 (where all dependent files will be stored with original names).
rm file1
Removes a file. Be careful, once you delete a file, there usually is no way to recover it.
rmdir dir1
Removes directory. In order for this command to work, the directory dir1 should not contain anything. If it does, you will first need to remove (rm) all files and directories from inside dir1 before you can rmdir dir1.

A.4 Uebungsbetrieb

A.4.1 Ausgabe

A number of sample programs illustrating various concepts in LISP as well as drawing files necessary for completing your exercises are available in the directory: /homes2/prog/ausgabe. The names of these files are given in relevant sections on the preceding pages of the script.

In your own account, you should keep relevant files for your exercises in separate directories named as u01, u02, u03, u04, etc.

In order to copy sample program files, change the current directory in a command tool to a relevant subdirectory, e.g. u03 for Kapitel 3. Then copy the appropriate file(s) as follows:

cp /homes2/prog/ausgabe/relevant_filename .

Program, drawing and menu files that you have to copy, modify, complete and resubmit as exercises, are stored in the directory ausgabe. The relevant files are stored as 06_name.dwg, 06_name.mnu, 06_name.lsp; for a drawing file, menu file or LISP file as the case may be. In order to copy these files, change to a relevant directory (e.g. u06), and then copy the appropriate files as follows:

cp /homes2/prog/ausgabe/06_name.dwg 06_yourname.dwg
cp /homes2/prog/ausgabe/06_name.mnu 06_yourname.mnu
cp /homes2/prog/ausgabe/06_name.lsp 06_yourname.lsp

where you should replace yourname with your name.

A.4.2 Abgabe

To submit your completed exercises, you should copy the files into directory: /homes2/prog/abgabe. For example, if a student named john has a drawing file and a LISP program file for exercise 6, the following commands will be needed to submit his files:

cd u06
cp 06_john.dwg /homes2/prog/abgabe/.
cp 06_john.lsp /homes2/prog/abgabe/.

Note: All file names must be in lower case, without exception.

Programming Script

Prog Content Vorwort ..1.. ..2.. ..3.. ..4.. ..5.. ..6.. ..7.. ..8.. ..9.. ..10.. ..11.. ..12.. ..13..

@ by Architektur und CAAD 1994.......... The Teacher Team