没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Pro
Johnson
Bash Programming
Companion
eBook
Available
Covering
Bash 4.0
this print for content only—size & color not accurate
Books for professionals By professionals
®
Cyan
MaGenTa
yelloW
BlaCk
US $34.99
Shelve in
Linux
User level:
Beginner–Intermediate
Intermediate–Advanced
Advanced
www.apress.com
SOURCE CODE ONLINE
Companion eBook
See last page for details
on $10 eBook version
ISBN 978-1-4302-1997-2
9 781430 219972
5 34 9 9
Pro Bash Programming:
Scripting the GNU/Linux Shell
Dear Reader,
The shell is a programming language! A shell script is as much a program as
anything written in C, Python, or any other programming language. Just
because shell scripts are easier to write doesn’t mean they should take a back-
seat to compiled programs or other scripting languages.
I wrote Pro Bash Programming to present a tutorial that introduces the shell,
and bash specifically, as a programming language. If you need a program to
accomplish a task on GNU/Linux or any other Unix-type system, I want you
to consider the shell before any other language. If you write a prototype for a
program using the shell, I want you to realize that you don’t need to translate it
to another language.
This book will give you a grounding in programming techniques used in
writing shell programs no matter what your past programming experience. If
you’ve never written a computer program before, Pro Bash Programming will
get you started and help you become a proficient shell programmer. If you
have written a few shell programs, this book will take you to the next level and
beyond. It will enable you to do things with the shell you never thought it could
do. If you are already an expert shell programmer, this book will provide insight
into the advanced shell programming, helping you write more, and more effi-
cient, scripts.
Bash is the shell of the Free Software Foundation’s GNU project and is the
standard shell on almost all Linux distributions. It is the shell you probably
use at the command line. It offers programmers many enhancements over the
standard Unix shell. You will find bash on many versions of Unix. It may not be
the default shell, but it is usually available for interpreting your scripts.
I hope this book will help you become a more productive programmer and
that your programs will be written using the Bash shell.
Chris F.A. Johnson
Author of
Shell Scripting Recipes:
A Problem-Solution
Approach
THE APRESS ROADMAP
Beginning the
Linux Command Line
Linux System
Administration Recipes
Beginning Portable Shell Scripting
Expert Shell
Scripting
Pro Bash
Programming
Beginning Perl 2nd Edition
Beginning Ubuntu LTS Server
Administration 2nd Edition
trim = 7.5" x 9.25" spine = 0.5625" 256 page count
The eXperT’s VoiCe
®
in linuX
Pro
Bash
Programming
Scripting the GNU/Linux Shell
Chris F.A. Johnson
Programming bash from one-liners
to professional programs
Covering
Bash 4.0
Download at WoweBook.Com
■ CONTENTS
i
Pro Bash Programming
Scripting the GNU/Linux Shell
■ ■ ■
Chris F.A. Johnson
Download at WoweBook.Com
■ CONENTS
ii
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 orders-ny@springer-sbm.com, or
visit http://www.springeronline.com.
For information on translations, please contact Apress directly at 233 Spring Street, New York, NY 10013.
E-mail info@apress.com, or visit http://www.apress.com.
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 Sales–eBook 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.
Download at WoweBook.Com
■ CONTENTS
iii
Contents at a Glance
■About the Author................................................................................................... xvi
■About the Technical Reviewer............................................................................. xvii
■Introduction.......................................................................................................... xix
■Chapter 1: Hello, World! Your First Shell Program ..................................................1
■Chapter 2: Input, Output, and Throughput...............................................................7
■Chapter 3: Looping and Branching ........................................................................19
■Chapter 4: Command-Line Parsing and Expansion...............................................29
■Chapter 5: Parameters and Variables....................................................................43
■Chapter 6: Shell Functions.....................................................................................59
■Chapter 7: String Manipulation..............................................................................67
■Chapter 8: File Operations and Commands ...........................................................79
■Chapter 9: Reserved Words and Builtin Commands .............................................97
■Chapter 10: Writing Bug-Free Scripts and Debugging the Rest..........................113
■Chapter 11: Programming for the Command Line..............................................125
■Chapter 12: Runtime Configuration .....................................................................141
■Chapter 13: Data Processing ...............................................................................157
■Chapter 14: Scripting the Screen.........................................................................179
■Chapter 15: Entry-Level Programming ................................................................191
■Appendix: Shell Variables....................................................................................205
■Index....................................................................................................................221
Download at WoweBook.Com
剩余257页未读,继续阅读
资源评论
- singpenny2012-07-27很好,资源不错,字迹清晰,而且是可复制的PDF格式,慢慢学习~
- maniacdown2012-12-09资源不错,但是书签不太好用
aansheng
- 粉丝: 1
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功