next up previous contents index
Next: 3. The Java Development Up: Lookout For A Free Previous: 1. Introduction   Contents   Index

Subsections


2. The Unix Standard Environment

2.1 What Is Unix/Linux ?

Unix is a operating system (OS) which supports the following capabilitys and more:

In the beginning, Unix was accessible for high performance mainframe systems but not for personal computers (PC). In the early 80´s, BSD-Unix supported Intel based PC´s. Today Linux is a free Unix and supports Motorola-68xxx, Alpha-, Intel- and other platforms.

Like other free software, Linux is distributed under the GNU General Public License (GPL). GNU-Software is distributed with it´s source-code, can be used for commercial-issues also. A Linux-System contains many other GNU-Software and is high avaiable. GNU-Software can be compiled and used on other platforms like Windows.

In the following the so called Unix standard development environment will be described. The big goal of a Unix environment is it´s portability. This means that a whole project can be ported to any Unix platform with less or no affort. The components of this environment are different and introduced below.

Because GNU-Software is avaiable on other platforms than Unix, many Unix-projects can be ported to those either. The GNU-Win32 Project [4] has ported a complete Unix-Layer inclusive the bash and utilitys to Windows 32 (95 & NT).

2.2 Shell And Shell-Scripts

Unix is controlled by the command line. Nowadays many software can be controlled by a GUI either. Nevertheless the command line is the important user interface in Unix. To make the command line convinient Unix offers several shells. A shell is the basic program which handles the keyboards input and the terminal output. The shell interprets the input and trys to perform the apropiate action. This could be a shell command which is built in the shell itself, or this could be a programm which is invoked by the shell. A shell has it´s environment variables, which can be set by the user and which can read out by programs. Mostly all shells support shell scripts. A shell script is like a little program which can be interpreted by the shell. Decisions, loops can be compined with the invokation of programs.

The most distributed shell is the kornshell. Kornshell scripts are high portable. The new convinient Borne again shell (Bash) is Kornshell compatible and has very fine convinient features like command line completion for path- and filename, history via cursor keys and so on.

2.3 X-Window-System

Because the user wants an graphical interface, a GUI, the X-Window-System (X) was developed. Because X is a Unix standard, programs have a unique grafical interface on a Unix system. Nowadays other platform than Unix offers X-Server, so that software can run or/and can be displayed on those.

A program using X is called the client. The display this program displays it´s data, is called the server. Client and server can be different platforms connected via the Internet.

The design of the X-Window-System allows networking, remote-applications, portable software.

To use specific grafical elements, so called widgets, another librarys are needed. E.g. the commercial motiv library contains many widgets and window types. Motif contains the Motif Windowmanager (MWM) also. A windowmanager manages the look and feel of the windows displayed with the X-Server.

2.4 Utilitys

The Unix environment has many little powerfull utilitys, command line tools. These written tools are designed to perform one action, nothing more, nothing less. For example, the df command shows the disk usage. All these little tools has as standard command line interface, and they should run on all Unix platforms well. The combination of shell scripts, these utilitys and other programs gives the developer the flexibility and comfort he needs.

Most of these tools acts like a filter. This means, that they will receive their input from the standard input, and puts their output to the standard output. These standard streams can be redirected and piped.

sed is a stream editor. With sed you can modify text files automatic. E.g. you need to convert all strings named ´foo´ to ´You´, you can use sed to convert all your files you need.

awk is a pattern matching interpreter. With awk you can specify patterns with regular expressions2.1 and a action which should be performed if awk finds the pattern. The action is a c-like block interpreted by awk.

2.5 Editor

The first editor on Unix was a line editor named ed. Later vi was born. vi is a full screen editor with the command syntax of ed and sed. vi can be found on all Unix installations and can be run on a terminal.

emax is a new editor, which is not part of a standard Unix installation. emax is more powerfull than vi and can be controlled and extended via severall scrip languages.

2.6 Revision Control System

To control the versions of all the projects files, you need a revision control system (RCS). The tasks for a RCS is to:

sccs, rcs and cvs are one of many RCS´s, which are avaiable under the GPL.

2.7 Compiler

To compile the source code to the platforms binary format, you need a compiler for the specific programming language.

Ansi-C, Ansi-C++, Fortran and Pascal are some of many important languages, where Ansi-C and Ansi-C++ is included in a standard unix installation. Ansi-C is the de facto Unix programming language. Both Ansi-C and Ansi-C++ are supported by the Gnu C Compiler (GCC). The GCC is avaiable under the GPL. You can use the GCC for many platforms and for cross platform development.

2.8 Linker and Standard-Librarys

The output of a compiler, e.g. GCC, is the object file with the postfix .o. To create a executable file, you still have to bind all needed object files and some standard librarys together. These bindings are done with the linker, named ld. Nowadays Unix systems uses the ELF binary format, which supports dynamic librarys. Dynamic librarys can be linked at runtime, so the executable file won´t consume disk- and memory-space for them. A standard library is for example the standard C or C++ library, which contains all string, input/output and other standard functions.

Other librarys can be used either, e.g. the X library to be able to use the X-Window-System.

2.9 Make

To built the goal, normaly the executable program, out of all source files, make can be used. make takes a makefile as its input. The makefile contains recepts for each procedure. A recept defines a goal, it´s needed source files and the action which should be done if one of the source files is older than the goal. The action could be a compilation, a linker but also a RCS command.

2.10 Debugger

If the written program does not do what is should do, often happens ;-), the programmer must analyze the code. A debugger helps to analyze the code and to find the error. An error in a program is called a bug. So the debugger should help fixing all those bugs, a program has. The debugger can show the values of variables, can set breakpoints where the program should stop, can step through the source code lines. Debugger does not replace the programmers brain, but they can help to visualize how the program work.

2.11 Profiler

If the written program consumes much time and looks like it is inefficient, a profiler may help. Profiler can show the costs, time consuming, of different parts of programs.

2.12 Lex & Yacc

With Lex & Yacc parsers can be written fast and easily. The syntax is written in an BNF style. Please refer chapter 3.6 on page [*] where these tools are compared with it's java aequivalent.

2.13

To write the documentation
citeKopka is a low cost and a free avaiable for all platforms text-setting compiler. The source is an easy ASCII text with some macro-programming features. Doing documentation with means not to let the layout be created and just to write the text while specifying the chapters, sections, footnotes, references, etc.

2.14 2Html

The documentation can easily converted to HTML using 2Html[7]. Thus the complete documentation can be put on a web server. 2Html supports the writer with many HTML features like generating links to other places, etc. Today Html 3.2 is supported.

Later in this documentation, section 4.4 on page [*]), you can find an approved example of using HTML-Source generated documentation.



Footnotes

... expressions2.1
regular expressions are also used in grep, vi and lex

next up previous contents index
Next: 3. The Java Development Up: Lookout For A Free Previous: 1. Introduction   Contents   Index
sven goethel
2000-11-21