bash Cookbook: Solutions and Examples for bash Users - O'Reilly Cookbooks

By Carl Albing, JP Vossen, Cameron Newham,
Publisher: O'Reilly Media, Inc.
Number Of Pages: 622
Publication Date: 2007-05-24
Sales Rank: 21680
ISBN / ASIN: 0596526784
EAN: 9780596526788
Binding: Paperback
Manufacturer: O'Reilly Media, Inc.
Studio: O'Reilly Media, Inc.
Average Rating: 5
The key to mastering any Unix system, especially Linux and Mac OS X, is a thorough knowledge of shell scripting. Scripting is a way to harness and customize the power of any Unix system, and it's an essential skill for any Unix users, including system administrators and professional OS X developers. But beneath this simple promise lies a treacherous ocean of variations in Unix commands and standards.
bash Cookbook teaches shell scripting the way Unix masters practice the craft. It presents a variety of recipes and tricks for all levels of shell programmers so that anyone can become a proficient user of the most common Unix shell -- the bash shell -- and cygwin or other popular Unix emulation packages. Packed full of useful scripts, along with examples that explain how to create better scripts, this new cookbook gives professionals and power users everything they need to automate routine tasks and enable them to truly manage their systems -- rather than have their systems manage them.
Review:
Taking Bash to the next level
Linux system admin is something I do as part of my job. I've been able to acquire the basics and get the job done, but I knew that there were better ways to get the job done. Nothing like having an expert to help learn the ins and outs.
This book allowed me to take it to the next level. There are many excellent examples on how to get it done, as well as advice on things that should not be done.
There is a good mix of newbie info as well as useful tips for the seasoned veteran. There's usually more than one way to get the job done, and this book showed me some new, better ways to accomplish the task at hand.
If you're working with bash, you'll find something useful in this book.
Review:
Solutions to problems for bash users of all skill levels
This book covers the GNU Bourne Again Shell, which is a member of the Bourne family of shells that includes the original Bourne shell sh, the Korn shell ksh, and the Public Domain Korn Shell pdksh. This book is for anyone who uses a Unix or Linux system, as well as system administrators who may use several systems on any given day. Thus, there are solutions and useful sections for all levels of users including newcomers. This book is full of recipes for creating scripts and interacting with the shell that will allow you to greatly increase your productivity.
Chapter 1, "Beginning bash" covers what a shell is, why you should care about it, and then the basics of bash including how you get it on your system. The next five chapters are on the basics that you would need when working with any shell - standard I/O, command execution, shell variables, and shell logic and arithmetic. Next there are two chapters on "Intermediate Shell Tools". These chapters' recipes use some utilities that are not part of the shell, but which are so useful that it is hard to imagine using the shell without them, such as "sort" and "grep", for example. Chapter nine features recipes that allow you to find files by case, date, type, size, etc. Chapter 10, "Additional Features for Scripting" has much to do with code reuse, which is something you find even in scripting. Chapter 11, "Working with Dates and Times", seems like it would be very simple, but it's not. This chapter helps you get through the complexities of dealing with different formats for displaying the time and date and converting between various date formats.
Chapter 12, "End-User Tasks As Shell Scripts", shows you a few larger though not large examples of scripts. They are meant to give you useful, real world examples of actual uses of shell scripts beyond just system administration tasks. Chapter 13, "Parsing and Similar Tasks", is about tasks that will be familiar to programmers. It's not necessarily full of more advanced scripts than the other recipes in the book, but if you are not a programmer, these tasks might seem obscure or irrelevant to your use of bash. Topics covered include parsing HTML, setting up a database with MySQL, and both trimming and compressing whitespace. Chapter 14 is on dealing with the security of your shell scripts. Chapters 15 through 19 finish up the book starting with a chapter on advanced scripting that focuses on script portability. Chapter 16 is related to the previous chapter on portability and is concerned with configuring and customizing your bash environment. Chapter 17 is about miscellaneous items that didn't fit well into any other chapter. The subjects include capturing file metadata for recovery, sharing and logging sessions, and unzipping many ZIP files at once. Chapter 18 deals with shortcuts aimed at the limiting factor of many uses of bash - the typing speed of the user and shortcuts that cut down on the amount of typing necessary. The final chapter in the book, "Tips and Traps", deals with the common mistakes that bash users make.
All in all this is a very handy reference for a vast number of the tasks that you'll come across when scripting with the bash shell along with well-commented code. Highly recommended
کد:
برای مشاهده محتوا ، لطفا وارد شوید یا ثبت نام کنید