bash Cookbook
Solutions and Examples for bash Users
Publisher: O'Reilly Media
Final Release Date: May 2007
Pages: 630

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.

Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillybash Cookbook
 
4.9

(based on 8 reviews)

Ratings Distribution

  • 5 Stars

     

    (7)

  • 4 Stars

     

    (1)

  • 3 Stars

     

    (0)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (0)

100%

of respondents would recommend this to a friend.

Pros

  • Concise (5)
  • Helpful examples (5)
  • Accurate (4)
  • Easy to understand (3)

Cons

    Best Uses

    • Intermediate (5)
    • Expert (3)
    • Novice (3)

    Reviewed by 8 customers

    Sort by

    Displaying reviews 1-8

    Back to top

    (1 of 1 customers found this review helpful)

     
    5.0

    Useful recipes for everyday life

    By JIghtuse

    from Novosibirsk, Russia

    About Me Developer

    Verified Reviewer

    Pros

    • Accurate
    • Concise
    • Easy to understand
    • Helpful examples

    Cons

      Best Uses

      • Expert
      • Intermediate
      • Novice

      Comments about oreilly bash Cookbook:

      Bash is one of the most common default shells. Like almost every GNU/Linux (or Unix-like OS) user I use bash everyday. bash Cookbook has plenty of recipes which helps to solve everyday problems or boost my productivity.

      My typical usage of this book come as follows:
      facing with problem I state it precisely and then search in Table of Contents for identical problem. Almost anytime I can find recipe which helps me. For example, I often forget how to redirect standard error and standard output to one file. Finding answer in this cookbook takes only one minute.

      Cookbook form allows this book to be precise and accurate. There are around 300 recipes for any almost problem you can face in the shell, from pretty simple ones (getting input from a file) to really advanced (using bash net-redirection). You rarely need to read all the cookbook to find it useful. It just gives you simple how-to without digging into theory. With this book it occurs too. I use a few recipes but I feel it will help me many more times in the future.

      So, I would definitely recommend this book to any user of Unix-like OS who uses shell in his everyday work, whether he is developer, system administrator or regular user.

       
      5.0

      a great way to learn command line power

      By Michael Larsen

      from San Bruno, CA

      About Me Software Tester

      Verified Reviewer

      Pros

      • Accurate
      • Concise
      • Helpful examples

      Cons

        Best Uses

        • Intermediate

        Comments about oreilly bash Cookbook:

        When I started working with a startup in 2011, I was overjoyed to receive a Macbook Pro as my primary work system. The reason? It meant I'd be able to get re-acquainted with the UNIX shell again after a long time away. Having been a regular user of the shell in the 90s, but having not worked with it regularly for many years, I figured the bash Cookbook would be a good way to get back into the swing of things and update my shell scripting vocabulary.

        This is the kind of book that, for all intents and purposes, is impossible to review completely. Generally speaking, these types of books serves two purposes. The first is that it presents a number of questions and issues, and then it provides potential answers. The second is that it works as a kind of roundabout reference guide (and not a complete one). Most people will not, if they are in their right minds, go through each one of these entries and try them serially. They will, instead, keep this book in reserve until they have a particular question, and then look up that solution and extrapolate if it and other associated suggestions may help them achieve a particular goal.

        It is with this consideration that I give some well deserved praise for the bash Cookbook. Note, if you are a newcomer to the bash shell, then this is going to be a confusing place to start. If you have worked with other shells and have familiarity with shell programming syntax, and have spent a little time online to learn some of the specifics of how the bash shell responds to user input, handles redirects, and understand some of its basic idiosyncrasies, then this will be a good, and fun, book to work through and play with.

        From basic interactions to advanced level operations and automation, each tip is structured the same way. A Problem is presented to the reader, usually in a one or two line format. The book then presents a Solution based on the previous Problem. Each section then follows with a Discussion that describes the particular technique or recipe in depth. Finally, there is a listing of "See Also" topics that might help inform the development of your scripts. Note, I have purchased the PDF version of this book, and the PDF version has fully indexed all of the "See Also" links to jump to those particular recipes (a wonderful time saver :) ).

        The cookbook style is not for everyone. This is not meant to be a pure tutorial guide or a structured reference. The cookbook format is structured to give various examples that, when experimented with, can lead to many jumping off points for your own scripts. Likewise, as with a standard cookbook, users will need to play around with the recipes and see if they will meet their specific needs, or see how much experimentation is required to get their desired result.

        Although it is set up in small topic sections, and while the topics do not necessarily blend into each other, the coverage is such that, if you do go through the first several chapters, you will learn a lot about shell interaction and methods of programming the shell. From there, having the ability to cross reference other suggestions in often far distant chapters can be quite helpful and help tie individual tips and tricks together.

        Bottom Line:

        For those who plan to use any variant of UNIX/Linux and want to be able to master many file related or text manipulation processes, the command line is the way to go. If you have any intention of using the UNIX command line, getting a handle on the many techniques available to users, the teeming number of utilities available, and a varied approach to learning about how to use them to solve particular problems (both general and specific), and bash happens to be your weapon of choice, and perchance you already have a basic familiarity with the process of programming the bash shell, then the bash cookbook would be a good addition to your personal reference library. It's a gift that keeps on giving.

        (1 of 1 customers found this review helpful)

         
        5.0

        For the serious BASH scripter

        By thejartender (The Jar Bar).

        from Borgund, Norway

        About Me Designer, Developer

        Verified Reviewer

        Pros

        • Accurate
        • Concise
        • Easy to understand
        • Helpful examples
        • Well-written

        Cons

          Best Uses

          • Expert
          • Intermediate
          • Novice
          • Student

          Comments about oreilly bash Cookbook:

          As always, Oreilly provides a CookBook (Bash) that (this time) goes beyond my Bash needs. I certainly will never part with this book.

          (2 of 2 customers found this review helpful)

           
          4.0

          Recipes to Command Line Mastery

          By TESTHEAD

          from San Francisco, CA

          Pros

          • Concise
          • Helpful examples

          Cons

            Best Uses

            • Intermediate
            • Novice

            Comments about oreilly bash Cookbook:

            When I started working with my current company, I was overjoyed to receive a Macbook Pro as my primary work system. The reason? It meant I'd be able to get re-acquainted with the UNIX shell again after a long time away. Having been a regular user of the shell in the 90s, but having not worked with it regularly for many years, I figured the bash Cookbook would be a good way to get back into the swing of things and update my shell scripting vocabulary.

            This is the kind of book that, for all intents and purposes, is impossible to review completely. Generally speaking, these types of books serves two purposes. The first is that it presents a number of questions and issues, and then it provides potential answers. The second is that it works as a kind of roundabout reference guide (and not a complete one). Most people will not, if they are in their right minds, go through each one of these entries and try them serially. They will, instead, keep this book in reserve until they have a particular question, and then look up that solution and extrapolate if it and other associated suggestions may help them achieve a particular goal.

            It is with this consideration that I give some well deserved praise for the bash Cookbook. Note, if you are a newcomer to the bash shell, then this is going to be a confusing place to start. If you have worked with other shells and have familiarity with shell programming syntax, and have spent a little time online to learn some of the specifics of how the bash shell responds to user input, handles redirects, and understand some of its basic idiosyncrasies, then this will be a good, and fun, book to work through and play with.

            From basic interactions to advanced level operations and automation, each tip is structured the same way. A Problem is presented to the reader, usually in a one or two line format. The book then presents a Solution based on the previous Problem. Each section then follows with a Discussion that describes the particular technique or recipe in depth. Finally, there is a listing of "See Also" topics that might help inform the development of your scripts. Note, I have purchased the PDF version of this book, and the PDF version has fully indexed all of the "See Also" links to jump to those particular recipes (a wonderful time saver :) ).

            The cookbook style is not for everyone. This is not meant to be a pure tutorial guide or a structured reference. The cookbook format is structured to give various examples that, when experimented with, can lead to many jumping off points for your own scripts. Likewise, as with a standard cookbook, users will need to play around with the recipes and see if they will meet their specific needs, or see how much experimentation is required to get their desired result.

            Although it is set up in small topic sections, and while the topics do not necessarily blend into each other, the coverage is such that, if you do go through the first several chapters, you will learn a lot about shell interaction and methods of programming the shell. From there, having the ability to cross reference other suggestions in often far distant chapters can be quite helpful and help tie individual tips and tricks together.

            Bottom Line:

            For those who plan to use any variant of UNIX/Linux and want to be able to master many file related or text manipulation processes, the command line is the way to go. If you have any intention of using the UNIX command line, getting a handle on the many techniques available to users, the teeming number of utilities available, and a varied approach to learning about how to use them to solve particular problems (both general and specific), and bash happens to be your weapon of choice, and perchance you already have a basic familiarity with the process of programming the bash shell, then the bash cookbook would be a good addition to your personal reference library. It's a gift that keeps on giving.

            (1 of 1 customers found this review helpful)

             
            5.0

            Bash Cookbok

            By George Mulak

            from Tustin, CA

            About Me Sys Admin

            Verified Reviewer

            Pros

            • Accurate
            • Concise
            • Easy to understand
            • Helpful examples
            • Well-written

            Cons

              Best Uses

              • Expert
              • Intermediate
              • Student

              Comments about oreilly bash Cookbook:

              I was tired of not being able to use the Bash shell. Although I have used Linux for awhile I wanted to become more familiar and understand it better.

              Although the authors state that the book is for new users I think it may be a little hard to get your head around directories and concepts if you didn't have a little experience with some shell. Mine was with DOS so I had no problem whatsoever.

              The authors progress through the work in a logical and progressive manner.

              I have seldom been let-down by O'Reilly Media. This was not the exception. Thanks for a great book.

              (4 of 4 customers found this review helpful)

               
              5.0

              Excellent bash book!

              By Robert Menes

              from Undisclosed

              Comments about oreilly bash Cookbook:

              I've been spending some time reading through the bash Cookbook, and I can't express disappointment in it at all. Quite the opposite, in fact: the bash Cookbook is one of the best bash books I've come across in a long time!

              Many of the recipes in the book cover all sorts of useful tasks; be it basic maintenance operations, or sorting photos and music with some quick shell scripts, there's a little something in this book for everyone! As a plus, this book has helped me improve my bash skills, enabling me to now use my beloved bash shell more efficiently!

              I highly recommend this title, but for the full experience, don't forget to pick up Learning the bash Shell to go along with this book. This book should go on any serious bash user's bookshelf!

              (2 of 2 customers found this review helpful)

               
              5.0

              bash Cookbook Review

              By mas7967

              from Undisclosed

              Comments about oreilly bash Cookbook:

              ISBN-10: 0-596-52678-4

              ISBN-13: 978-0-596-52678-8

              Information from the publisher

              Bash Cookbook is a great book for anyone who is interested in learning more about bash and shell scripting. The book starts off with its first chapters dedicated to beginners and learning what bash is, how the prompt works, and how exactly shell scripting works. As the book progresses further, the examples and topics get to an intermediate level, and finally end with an advanced level. The book is packed with wonderful examples and full explanations of all parts of bash.

              I had very little knowledge of bash and any sort of scripting before reading this book. I started at the beginning even though I knew some of the topics that were covered, but I still learned things from the tips, which are scattered throughout the book. This book is a good fit for anyone that has very little experience. It explains every type of variable, how to make them, their uses, and shows examples of them in use. It does the same for loops, logic and arithmetic, and every other topic covered in the book. At the very end of the book there are nearly one hundred pages of appendixes which are a wonderful resource full of tables and sample code.

              I feel very comfortable after reading this book to do more advanced tasks with bash and shell scripting. I strongly suggest this book to anyone who is interested in leaping into a UNIX shell for the first time. The book is very up to date as it was published in May of 2007, and I plan to use it as a reference for every bash questions I could have.

              (8 of 8 customers found this review helpful)

               
              5.0

              Bashscripts.org - Review of bash Cookbook""

              By Crouse

              from Undisclosed

              Comments about oreilly bash Cookbook:

              Bashscripts.org - Review of "bash Cookbook"

              The book: bash Cookbook - Solutions and Examples for bash Users

              By Carl Albing, JP Vossen, Cameron Newham

              Pages: 622

              First Edition: May 2007

              ISBN 10: 0-596-52678-4

              ISBN 13: 9780596526788

              Book Link: http://www.oreilly.com/catalog/9780596526788/index.html

              Code Examples: http://examples.oreilly.com/bashckbk/

              Price: $49.99 USD

              I had been waiting "im"-patiently for this book to show up. Ever since I noticed it was going to be written, I had been looking forward to reading it. I must say, I wasn't disappointed. I really enjoyed the book and definitely learned a few new things along the way.

              This book is designed for intermediate to advanced bash users. The book states in the preface that it is for "new" users as well as those more experienced. I think that they give too much credit to someone new too bash. If you don't know what bash scripting is, this book ISN'T for you. Try the book "Learning the Bash Shell", it would be much better to learn from. I'll say it one more time -- This book isn't for those new to shell scripting. In my opinion, it kind of picks up where "Learning the Bash Shell" and "Classic Shell Scripting" from O'reilly left off. It compliments both books pretty well. Where "Learning the Bash Shell" teaches you the basics, and "Classic Shell Scripting" builds on the concepts and materials covered in the chapter before, so it's a book that is best read front to back and not just used as a reference, this book is truly more of a reference that you can use to find solutions to different problems. Hence the "cookbook" in the title.

              As an intermediate to advanced user, you will find many of the solutions very simple and straightforward, but I dare say, you will find a few new twists and solutions that you might not have thought of otherwise. When used a reference, it provides a nice Table of Contents with good descriptions that allow you to quickly find answers to many common problems. Examples are clear, concise, and well documented, making it fairly easy to follow along, even if you didn't understand the syntax of the code at first. I liked the fact they included many examples of sed,awk, and even ed, which are frequently used in shell scripting, but many books barely mention those programs.

              The Appendix sections (A-E) take up 83 pages of the book, several of these could very well have just been additional chapters of the book. Appendix E "Building bash from Source" could have been chapter 1. However, each chapter/section is a "recipe" so I suppose it wouldn't have been in line with the rest of the chapters at that point. All in all, a very interesting book that I read front to back. It will be a valuable reference tool, that's easy to navigate and use. The chapters I enjoyed the most were Chapter 14 "Writing Secure Shell Scripts", where they included a template for quick reference. Several of the techniques I already knew about, a few I did not. I also liked Chapter 11 "Working with Dates and Times". Many good ideas there, and some very interesting code for the "date -d" command.

              There are 3 great books for shell scripters from O'reilly, this is one of them.

              For the beginner "Learning the Bash Shell". It teaches you the basics.

              For the intermediate user "Classic Shell Scripting". It builds on the basics, step by step.

              For the intermeidate to advanced users "bash Cookbook". A reference guide for common problems.

              I would probably recommend reading them in that order as well. "bash Cookbook" is definitely going to be easier to read and get use of if you already know basic shell scripting. All 3 books have that "tattered" look and a permanent place on my bookshelf. I would say, "bash Cookbook" is absolutely a book worth owning if you enjoy shell scripting. I don't think I've ever seen a more complete set of solutions in a shell scripting book. In the preface, one thing that caught my eye ..... But perhaps most importantly, we hope that when you have a question about how to do something or you need a hint, you will be able to easily find the right answer--or something close enough-- and save time and effort. ------ I think they accomplished their goal ! 5 out of 5. Excellent book...excellent.

              Dave Crouse

              Bashscripts.org http://bashscripts.org

              USA Linux Users Group http://usalug.org

              Displaying reviews 1-8

              Back to top

               
              Buy 2 Get 1 Free Free Shipping Guarantee
              Buying Options
              Immediate Access - Go Digital what's this?
              Ebook: $41.99
              Formats:  APK, DAISY, ePub, Mobi, PDF
              Print & Ebook: $54.99
              Print: $49.99