Beginning Linux Programming
Authors: Neil Matthew and Richard Stones
Publisher: Wrox Press
Pages: 710
ISBN: 1-874416-68-0
Price: $36.95
Reviewer: Mark Shacklette
Every once in a while a book appears which so perfectly fills a void that its acceptance is all but guaranteed. For Linux programmers or anyone interested in learning Unix programming, there is a new volume to add to your library: Beginning Linux Programming by Neil Matthew and Richard Stones. The book is an achievement both in terms of its subject coverage as well as its surprising depth for a text whose focus, as the title states, is the neophyte. The authors' aim is “to cover enough about a wide range of topics to give you a good beginning in each subject.” In this they succeed magnificently. Inside are full chapters on shell programming (/bin/sh), an introduction to the Unix file system, terminal I/O, the curses library and a chapter on processes and signals. There is a chapter on how to use the GNU gcc compiler, the gdb debugger, make, RCS and other development tools. (They even teach you the basics of how to write a man page for all those new applications you'll write after mastering Linux programming.) The authors cover Linux's X/Open-compliant dbm database (some distributions have gdbm, the GNU flavor of dbm). They devote one hundred and fourteen pages to interprocess communication alone, including pipes, FIFOs, System V IPC (Semaphores, Message Queues, Shared Memory) and Berkeley sockets. There is a 93-page introduction to X programming which focuses primarily on Tcl, Tk and Wish, along with a sip of Java. The book concludes with two chapters devoted to Internet programming, one covering HTML and the other CGI.
With such a vast scope, something had to be left out. Coverage of Expect is assigned to two short paragraphs. Python is missing, as is the majority of Motif programming outside of Tcl/Tk (Xlib and Xt are only mentioned in passing). The only coverage of Perl is an example CGI script, and the section on Java could pass by you entirely, if your nose is not careful to pick up the scent of the fresh brew at the close of the discussion of X programming. (Interesting that Java is appended to X programming, not the Internet programming chapters.) Nevertheless, such focus is necessary to avoid a text of several volumes and to concentrate on the omissions would be to miss the point of the work, which is to introduce you to Linux programming through the use of hands-on code examples, which are graduated and presented in a step-by-step fashion. Each new topic is presented in a few short paragraphs and is followed by a succinct but complete “Try It Out” code example.
Over 10,000 lines of source code fill the pages, all of which are available for download (the ubiquitous CD is missing from the back cover). With such a supply of source code, the usual peccadilloes occur, such as a case statement in the section on shell programming, that lists the case as “[nN]*” (with quotes) instead of [nN]* without the quotation marks (the former fails if you enter anything beginning with a n or a N); or when, during the discussion of pipes, the line:
sprintf(buffer, "Once apon a time, there ..."\n)
is magically spell-checked to “Once upon a time” in the book's output listing (unfortunately, my compiler isn't as smart as the editors and keeps the spelling as “apon”). All in all, the source code compiles and runs fine. Wrox Press, the publisher, has the source and a sample chapter on its web site for your perusal, at http://www.wrox.com/.
The example code gets to the point. The authors present the minimum amount of code to illustrate an idea which, once given, is quickly summarized as they move on to the next extrapolation or improvement. This approach allows the new Linux programmer to get a firm grasp on the subject without too much diversion or interdependence. All examples are self-contained and may be compiled and run—there are no code fragments here. Such an approach facilitates and encourages the reader to experiment with the code examples, since they are so confined few side effects can be introduced, even by the most intrepid of newbies.
Although most of the examples are focused, the authors do present and develop a larger application that implements a simple audio CD cataloging program. The application begins life early in Chapter 2 as an extremely simple shell script that exercises the use of flow-control statements in shell programming and uses simple text files for a database. The application reappears in Chapter 6. This time rewritten in C with the same functionality as the shell script version and with a new interface designed to exercise the curses terminal library. In Chapter 7, the application acquires a real database, dbm. In Chapter 11, the application evolves into a small client-server system, which separates the database from the user interface through the use of named pipes. This example illustrates process synchronization and bi-directional data flow between a single server and multiple clients. In Chapter 12, the application substitutes a message queue for the named pipes from the previous chapter, which solves some problems with I/O synchronization previously encountered with named pipes. Finally, the CD application takes to the Web in Chapter 17 as an example of an HTML interface talking out a CGI layer to the database server. This chameleon-like application greatly enhances the communication of many of the principles presented in the book.
In short, Beginning Linux Programming is a tutorial on the major topics in Linux programming. If you are willing to spend some time getting up to speed, you will find yourself with a book that not only will hold your hand in the midst of the Magic Garden, but will eventually provide you with a fine pair of walking shoes, well preparing you for your own explorations. With this book at your side, as my son's beginning reader puts it:
You have brains in your head.You have feet in your shoes.You can steer yourselfany direction you choose.
Mark Shacklette is a Principal with Lake Shore MicroTech Group, a Chicago-based consultancy specializing in client-server development in Unix and Windows NT. When he's not with a client, he works on his Ph.D. in the “Committee on Social Thought” at the University of Chicago. He lives in Des Plaines, Illinois with his wife Karen, son David and two cats. He can be reached at jmshackl@midway.uchicago.edu.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- RSS Feeds
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- Developer Poll
- Dart: a New Web Programming Experience
- May 2013 Issue of Linux Journal: Raspberry Pi
- What's the tweeting protocol?




2 hours 13 min ago
2 hours 59 min ago
4 hours 33 min ago
6 hours 10 min ago
8 hours 8 min ago
8 hours 25 min ago
8 hours 55 min ago
8 hours 55 min ago
8 hours 56 min ago
11 hours 57 min ago