• Complain

Chris F.A. Johnson [Chris F.A. Johnson] - Pro Bash Programming: Scripting the GNU/Linux Shell

Here you can read online Chris F.A. Johnson [Chris F.A. Johnson] - Pro Bash Programming: Scripting the GNU/Linux Shell full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2009, publisher: Apress, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Chris F.A. Johnson [Chris F.A. Johnson] Pro Bash Programming: Scripting the GNU/Linux Shell

Pro Bash Programming: Scripting the GNU/Linux Shell: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Pro Bash Programming: Scripting the GNU/Linux Shell" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

The bash shell is a complete programming language, not merely a glue to combine external Linux commands. By taking full advantage of shell internals, shell programs can perform as snappily as utilities written in C or other compiled languages. And you will see how, without assuming Unix lore, you can write professional bash 4.0 programs through standard programming techniques.

  • Complete bash coverage

  • Teaches bash as a programming language

  • Helps you master bash 4.0 features

Chris F.A. Johnson [Chris F.A. Johnson]: author's other books


Who wrote Pro Bash Programming: Scripting the GNU/Linux Shell? Find out the surname, the name of the author of the book and a list of all author's works by series.

Pro Bash Programming: Scripting the GNU/Linux Shell — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Pro Bash Programming: Scripting the GNU/Linux Shell" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make

Pro Bash Programming: Scripting the GNU/Linux Shell

Copyright 2009 by Chris F.A. Johnson

All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher.

ISBN-13 (pbk): 978-1-4302-1997-2

ISBN-13 (electronic): 978-1-4302-1998-9

Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1

Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.

Lead Editor: Frank Pohlmann

Technical Reviewer: Ed Schaefer

Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Tony Campbell,
Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie,
Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft,
Matt Wade, Tom Welsh

Project Manager: Kylie Johnston

Copy Editor: Kim Wimpsett

Compositor: ContentWorks, Inc.

Indexer: Julie Grady

Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail .

For information on translations, please contact Apress directly at 233 Spring Street, New York, NY 10013. E-mail .

Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk SaleseBook Licensing web page at http://www.apress.com/info/bulksales.

The information in this book is distributed on an "as is" basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work.

The source code for this book is available to readers at http://www.apress.com.

Contents at a Glance
Contents
About the Author

After almost 20 years in magazine and newspaper publishing variously as - photo 1After almost 20 years in magazine and newspaper publishing, variously as writer, editor, graphic designer, and production manager, Chris F.A. Johnson now earns his living composing cryptic crossword puzzles, teaching chess, designing and coding web sites, and programming...and writing books about shell scripting. His first book, Shell Scripting Recipes: A Problem-Solution Approach, was published by Apress in 2005.

Introduced to Unix in 1990, Chris learned shell scripting because there was no C compiler on the system. His first major project was a menu-driven, user-extensible database system with a report generator. Constantly writing scripts for any and all purposes, his recent shell projects have included utilities for manipulating crossword puzzles and preparing chess resources for his students.

About the Technical Reviewer

Ed Schaefer is an ex-paratrooper an ex-military intelligence officer an - photo 2Ed Schaefer is an ex-paratrooper, an ex-military intelligence officer, an ex-oil field service engineer, and a past contributing editor and columnist for Sys Admin. He's not a total has-been. He earned a BSEE from South Dakota School of Mines and an MBA from USD.

Currently, he fixes microstrategy and teradata problemswith an occasional foray into Linuxfor a Fortune 50 company.

Introduction

Although most users think of the shell as an interactive command interpreter, it is really a programming language in which each statement runs a command. Because it must satisfy both the interactive and programming aspects of command execution, it is a strange language, shaped as much by history as by design.

Brian Kernighan and Rob Pike, The UNIX Programming Environment, Prentice-Hall, 1984

The shell is a programming language. Don't let anyone tell you otherwise. The shell is not just glue that sticks bits together. The shell is a lot more than a tool that runs other tools. The shell is a complete programming language!

When a Linux user asked me about membership databases, I asked him what he really needed. He wanted to store names and addresses for a couple of hundred members and print mailing labels for each of them. I recommended using a text editor to store the information in a text file, and I provided a shell script to create the labels in PostScript. (The script, ps-labels, appeared in my first book, Shell Scripting Recipes: A Problem-Solution Approach.)

When the SWEN worm was dumping hundreds of megabytes of junk into my mailbox every few minutes, I wrote a shell script to filter them out on the mail server and download the remaining mail to my home computer. That script has been doing its job for several years.

I used to tell people that I did most of my programming in the shell but switched to C for anything that needed the extra speed. It has been several years since I have needed to use C, so I no longer mention it. I do everything in the shell.

A shell script is as much a program as anything written in C, Python, or any other language. Just because shell scripts are easier to write doesn't mean they should take a backseat to compiled programs or other scripting languages. I use the terms script and program interchangeably when referring to tasks written in the shell.

Why the Shell?

Some Linux users do all of their work in a GUI environment and never see a command line. Most, however, use the shell at least occasionally and know something about Unix commands. It's not a big step from there to saving oft-repeated commands in a script file. When they need to extend the capabilities of their system, the shell is the natural way to go.

The shell also has important advantages over other programming languages:

  • It interfaces simply and seamlessly with the hundreds of Unix utilities.
  • It automatically expands wildcards into a list of file names.
  • Lists contained in a variable are automatically split into their constituent parts.
Just the Shell, Ma'am, Just the Shell

While most shell programs do call external utilities, a lot of programming can be done entirely in the shell. Many scripts call just one or two utilities for information that is used later in the script. Some scripts are little more than wrappers for other commands such as awk, grep, or sed.

This book is about programming in the shell itself. There's a sprinkling of the second type, where the script gets information (such as the current date and time) and then processes it. The third type gets barely more than a cursory nod.

A Brief History of sh

The Bourne shell was the first Unix shell in general use. It was much more limited than today's shells, so it was primarily a tool to run other tools. It had variables, loops, and conditional execution, but the real work was done almost entirely by external utilities.

The C shell, csh, added command history, arithmetic, and other features that made it popular as a command-line interpreter, but it was not suitable for more than trivial scripts.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Pro Bash Programming: Scripting the GNU/Linux Shell»

Look at similar books to Pro Bash Programming: Scripting the GNU/Linux Shell. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Pro Bash Programming: Scripting the GNU/Linux Shell»

Discussion, reviews of the book Pro Bash Programming: Scripting the GNU/Linux Shell and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.