Use bash Like a Unix Master
Actor Matt Damon recently announced that he would not play Bourne again, giving Unix enthusiasts everywhere pause to wonder. The Bourne Again Shell, or bash for short, is a modern, general-purpose shell, freely available, and the shell of choice for users of Linux, Mac OS X, BSD, and other popular systems. As immensely useful as it is, it is not typically something you play as you would Tetris or Warcraft. Whether you’re a system administrator, programmer, or end user, there are countless occasions when a simple shell script can save you time and effort. The bash Cookbook (O’Reilly) by Carl Albing, JP Vossen, and Cameron Newham, is packed with examples and advice for anyone who wants to learn shell scripting the way Unix masters practice the craft.
bash Cookbook offers complete working scripts that let you customize and harness the power of your operating system. It provides many ways to automate routine tasks and scripting solutions to scores of common problems related to input/output, file manipulation, program execution, administrative tasks, and much more. Each reciped includes one or more code examples and a discussion of why the solution works.
“GUIs will only take you so far, then you need to write scripts, or spend hours pointing and clicking to do housekeeping chores, cleanup, and admin work,” observes Albing. “As users get more sophisticated, they want to write scripts to automate the tasks they have to do over and over again, or tasks that deal with large numbers of files.”
“Users of all skill levels should be more comfortable, more effective, and faster at the bash prompt after reading this book,” says Vossen, adding, “I love the Cookbook series and wanted to pick up where ‘Learning the bash Shell’ left off to documents the tips and tricks I’ve learned, and the traps I’ve fallen into, over the years.”
The book provides a quick reference to real examples of all sorts of shell features, helping you to:
Perform common tasks with solutions that address the repertoire of things you do every day
Write scripts to convert between DOS and Unix formats, work with compressed files, edit files automatically, work with dates and times, and more
Apply many tools commonly used with shell programs, including grep, sed, awk, and sort
Integrate recipes for interactive use, such as command history
Create functions, use aliases, and perform other tasks that make your life easier
Learn short cuts that allow you to work faster by typing less
Write more secure shell scripts that avoid the most common security weaknesses
Configure and customize bash to suit your individual needs and style
“This is not dry syntax reference material,” says Albing. “It contains the actual use of features in working examples—examples that people can cut and paste into their own working scripts.”
bash Cookbook gives you everything you need to accomplish more, in less time, with greater ease and consistency, so you can manage your systems rather than have your systems manage you.