21.07.2015 Views

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix B: Installing gawk 279reserved meaning. Instead, you must use a comma to separate elements in the path. Whenrecompiling, the separating character can be modified by initializing the envsep variable in‘unsupported/atari/gawkmisc.atr’ to another value.Although awk allows great flexibility in doing I/O redirections from within a program,this facility should be used with care on the ST running under TOS. In some circumstances,the OS routines for file-handle pool processing lose track of certain events, causing thecomputer to crash and requiring a reboot. Often a warm reboot is sufficient. Fortunately,this happens infrequently and in rather esoteric situations. In particular, avoid having onepart of an awk program using print statements explicitly redirected to ‘/dev/stdout’, whileother print statements use the default standard output, and a calling shell has redirectedstandard output to a file.When gawk is compiled with the ST version of gcc and its usual libraries, it acceptsboth ‘/’ and ‘\’ as path separators. While this is convenient, it should be remembered thatthis removes one technically valid character (‘/’) from your file name. It may also createproblems for external programs called via the system function, which may not support thisconvention. Whenever it is possible that a file created by gawk will be used by some otherprogram, use only backslashes. Also remember that in awk, backslashes in strings have tobe doubled in order to get literal backslashes (see Section 2.2 [Escape Sequences], page 25).B.4.2 Installing gawk on BeOSSince BeOS DR9, all the tools that you should need to build gawk are included with BeOS.The process is basically identical to the Unix process of running configure and then make.Full instructions are given below.You can compile gawk under BeOS by extracting the standard sources and runningconfigure. You must specify the location prefix for the installation directory. For BeOSDR9 and beyond, the best directory to use is ‘/boot/home/config’, so the configurecommand is:configure --prefix=/boot/home/configThis installs the compiled application into ‘/boot/home/config/bin’, which is alreadyspecified in the standard PATH.Once the configuration process is completed, you can run make, and then ‘make install’:$ make...$ make installBeOS uses bash as its shell; thus, you use gawk the same way you would under Unix. Ifthese steps do not work, please send in a bug report (see Section B.5 [Reporting Problemsand Bugs], page 280).B.4.3 Installing gawk on a TandemThe Tandem port is only minimally supported. The port’s contributor no longer has accessto a Tandem system.The Tandem port was done on a Cyclone machine running D20. The port is pretty cleanand all facilities seem to work except for the I/O piping facilities (see Section 3.8.5 [Usinggetline from a Pipe], page 54, Section 3.8.6 [Using getline into a Variable from a Pipe],

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!