Part IV: GNULinux Shells and Scripting


Chapter List

Chapter 19: GNU/Linux Commands
Chapter 20: The Bourne-Again Shell (bash)
Chapter 21: Editing with sed
Chapter 22: Text Processing with Awk
Chapter 23: Parser Generation with flex and bison

Part Overview

In this part of the book, well look at the topic of scripting languages. While scripting languages are historically tied to shells, scripting is a much larger topic. Well cover bash scripting, domain-specific languages such as Sed and Awk, and finally building interpreters with flex and bison .

Chapter 19, GNU/Linux Commands

GNU/Linux includes a large set of commands that aid in software development. Well look at a variety of the most commonly used commands and cover them in a tutorial fashion, including numerous examples.

Chapter 20, The Bourne-Again Shell (bash)

The bash shell is the de facto standard shell for GNU/Linux. Shell programming is very beneficial to understand because it permits developers to code repetitive tasks quickly. Shell programming can be slower than compiling to the native instruction set, but efficiency isnt always the most important aspect of development. Compiling source to a native image takes time. The great advantage to scripting is that you can execute your script immediately. This makes scripting languages perfect for prototyping. Many scripting languages also allow the script to be performed interactively, which makes it much easier for them to be understood .

Chapter 21, Editing with sed

The sed utility (stream editor) is a noninteractive text editing utility that is quite useful in performing global editing of files. sed can be used on a single file or many files, and although it is cryptic, it is generally a useful tool that solves a number of text editing problems. This chapter introduces sed and describes its use in a number of simple and complex examples.

Chapter 22, Text Processing with Awk

While some consider the Awk utility an advancement of Sed , it is in its own right a high-level procedural programming language. Awk was designed for text pattern processing on files, but it has evolved into a compact language that is useful in a number of areas. Awk is very convenient in prototyping because it is interpreted, and programs can be developed and tested quickly. The Awk programming language is useful and can be very beneficial to GNU/Linux developers.

Chapter 23, Parser Generation with flex and bison

The development of parsers was traditionally limited to those with extensive experience in parsing and compiler theory. With the introduction of lex and yacc (and the GNU replacements , flex and bison ), building parsers is much simplified as the difficult work is done for you. The flex tool is a lexical analyzer generator that creates programs for tokenization of input files. The bison tool, working in concert with the lexer, generates a grammar parser to validate the correctness of input tokens. Each of these tools takes an input file defining the token structure and grammar and produces C source to perform tasks. This makes the development of parsers simple and very maintainable . In this chapter, flex and bison are introduced through multiple examples of tokenization and grammar parsing.




GNU/Linux Application Programming
GNU/Linux Application Programming (Programming Series)
ISBN: 1584505680
EAN: 2147483647
Year: 2006
Pages: 203
Authors: M. Tim Jones

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net