Cover image for Shell Scripting : Expert Recipes for Linux, Bash and More.
Shell Scripting : Expert Recipes for Linux, Bash and More.
Title:
Shell Scripting : Expert Recipes for Linux, Bash and More.
Author:
Parker, Steve.
ISBN:
9781118166338
Personal Author:
Edition:
1st ed.
Physical Description:
1 online resource (603 pages)
Contents:
Shell Scripting: Expert Recipes for Linux, Bash, and More -- Contents at a Glance -- Dedication -- About the Author -- About the Technical Editor -- Credits -- Acknowledgments -- Contents -- Introduction -- What This Book Covers -- How This Book Is Structured -- What You Need to Use This Book -- Conventions -- Source Code -- Errata -- p2p.wrox.com -- Part I: About the Ingredients -- Chapter 1: The History of Unix, GNU, and Linux -- Unix -- "Everything Is a File" and Pipelines -- BSD -- GNU -- Linux -- Summary -- Chapter 2: Getting Started -- Choosing an OS -- GNU/Linux -- The BSDs -- Proprietary Unix -- Microsoft Windows -- Choosing an Editor -- Graphical Text Editors -- Terminal Emulation -- Nongraphical Text Editors -- Setting Up the Environment -- The Shell Profile -- Aliases -- Vim Settings -- Summary -- Chapter 3: Variables -- Using Variables -- Typing -- Assigning Values to Variables -- Positional Parameters -- Return Codes -- Unsetting Variables -- Preset and Standard Variables -- BASH_ENV -- BASHOPTS -- SHELLOPTS -- BASH_COMMAND -- BASH_SOURCE, FUNCNAME, LINENO and BASH_LINENO -- SHELL -- HOSTNAME and HOSTTYPE -- Working Directory -- PIPESTATUS -- TIMEFORMAT -- PPID -- RANDOM -- REPLY -- SECONDS -- BASH_XTRACEFD -- GLOBIGNORE -- HOME -- IFS -- PATH -- TMOUT -- TMPDIR -- User Identification Variables -- Summary -- Chapter 4: Wildcard Expansion -- Filename Expansion (Globbing) -- Bash Globbing Features -- Shell Options -- Regular Expressions and Quoting -- Overview of Regular Expressions -- Quoting -- Summary -- Chapter 5: Conditional Execution -- If/Then -- Else -- elif -- Test ([) -- Flags for Test -- File Comparison Tests -- String Comparison Tests -- Regular Expression Tests -- Numerical Tests -- Combining Tests -- Case -- Summary -- Chapter 6: Flow Control Using Loops -- For Loops -- When to Use For Loops.

Imaginative Ways of Feeding "For" with Data -- C-Style For Loops -- While Loops -- When to Use While Loops -- Ways to Use While Loops -- Nested Loops -- Breaking and Continuing Loop Execution -- While with Case -- Until Loops -- Select Loops -- Summary -- Chapter 7: Variables Continued -- Using Variables -- Variable Types -- Length of Variables -- Special String Operators -- Stripping Variable Strings by Length -- Stripping from the End of the String -- Stripping Strings with Patterns -- Searching Strings -- Using Search and Replace -- Replacing Patterns -- Deleting Patterns -- Changing Case -- Providing Default Values -- Indirection -- Sourcing Variables -- Summary -- Chapter 8: Functions and Libraries -- Functions -- Defining Functions -- Function Output -- Writing to a File -- Redirecting the Output of an Entire Function -- Functions with Trap -- Recursive Functions -- Variable Scope -- Libraries -- Creating and Accessing Libraries -- Library Structures -- Network Configuration Library -- Use of Libraries -- Getopts -- Handling Errors -- Getopts within Functions -- Summary -- Chapter 9: Arrays -- Assigning Arrays -- One at a Time -- All at Once -- By Index -- All at Once from a Source -- Read from Input -- Accessing Arrays -- Accessing by Index -- Length of Arrays -- Accessing by Variable Index -- Selecting Items from an Array -- Displaying the Entire Array -- Associative Arrays -- Manipulating Arrays -- Copying an Array -- Appending to an Array -- Deleting from an Array -- Advanced Techniques -- Summary -- Chapter 10: Processes -- The ps Command -- ps Line Length -- Parsing the Process Table Accurately -- killall -- The /proc pseudo-filesystem -- prtstat -- I/O Redirection -- Appending Output to an Existing File -- Permissions on Redirections -- Exec -- Using exec to Replace the Existing Program -- Using exec to Change Redirection -- Pipelines.

Background Processing -- Wait -- Catching Hangups with nohup -- Other Features of /proc and /sys -- Version -- SysRq -- /proc/meminfo -- /proc/cpuinfo -- /sys -- /sys/devices/system/node -- Sysctl -- Summary -- Chapter 11: Choosing and Using Shells -- The Bourne Shell -- The KornShell -- The C Shell -- The Tenex C Shell -- The Z Shell -- The Bourne Again Shell -- The Debian Almquist Shell -- Dotfiles -- Interactive Login Shells -- Interactive Non-Login Shells -- Non-Interactive Shells -- Logout Scripts -- Command Prompts -- The PS1 Prompt -- The PS2, PS3, and PS4 Prompts -- Aliases -- Timesavers -- Modifying Behaviors -- History -- Recalling Commands -- Searching History -- Timestamps -- Tab Completion -- ksh -- tcsh -- zsh -- bash -- Foreground, Background, and Job Control -- Backgrounding Processes -- Job Control -- nohup and disown -- Summary -- Part II: Recipes for Using and Extending System Tools -- Chapter 12: File Manipulation -- stat -- cat -- Numbering Lines -- Dealing with Blank Lines -- Non-Printing Characters -- cat Backwards is tac -- Redirection -- Redirecting Output: The Single Greater-Than Arrow (>) -- Appending: The Double Greater-Than Arrow (>>) -- Input Redirection: The Single Less-Than Arrow (<) -- Here Documents: The Double Less-Than Arrow (<< EOF) -- dd -- df -- mktemp -- join -- install -- grep -- grep Flags -- grep Regular Expressions -- split -- tee -- touch -- find -- find -exec -- Summary -- Chapter 13: Text Manipulation -- cut -- echo -- dial1 -- dial2 -- Fmt -- Head and Tail -- Prizes -- World Cup -- od -- paste -- pr -- printf -- shuf -- Dice Thrower -- Card Dealer -- Travel Planner -- sort -- Sorting on Keys -- Sorting Log Files by Date and Time -- Sorting Human-Readable Numbers -- tr -- uniq -- wc -- Summary -- Chapter 14: Tools for Systems Administration -- basename -- date -- Typical Uses of date.

More Interesting Uses of date -- dirname -- factor -- identity, groups, and getent -- logger -- md5sum -- mkfifo -- Master and Minions -- Reversing the Order -- Networking -- telnet -- netcat -- ping -- Scripting ssh and scp -- OpenSSL -- nohup -- seq -- Integer Sequences -- Floating Point Sequences -- sleep -- timeout -- Shutdown Script -- Network Timeout -- uname -- uuencode -- xargs -- yes -- Summary -- Part III: Recipes for Systems Administration -- Chapter 15: Shell Features -- Recipe 15-1: Installing Init Scripts -- Technologies Used -- Concepts -- Potential Pitfalls -- Structure -- Recipe -- Invocation -- Summary -- Recipe 15-2: RPM Report -- Technologies Used -- Concepts -- Potential Pitfalls -- Structure -- Recipe -- Invocation -- Summary -- Recipe 15-3: Postinstall Scripts -- Technologies Used -- Concepts -- Potential Pitfalls -- Structure -- Recipe -- Invocation -- Summary -- Chapter 16: Systems Administration -- Recipe 16-1: init Scripts -- Technologies Used -- Concepts -- Potential Pitfalls -- Structure -- Recipe -- Invocation -- Summary -- Recipe 16-2: CGI Scripts -- Technologies Used -- Concepts -- Potential Pitfalls -- Structure -- Recipe -- Invocation -- Summary -- Recipe 16-3: Configuration Files -- Technologies Used -- Concepts -- Potential Pitfalls -- Structure -- Recipe -- Invocation -- Summary -- Recipe 16-4: Locks -- Technologies Used -- Concepts -- Potential Pitfalls -- Structure -- Recipe -- Invocation -- Summary -- Chapter 17: Presentation -- Recipe 17-1: Space Game -- Technologies Used -- Concepts -- Potential Pitfalls -- Structure -- Recipe -- Invocation -- Summary -- Chapter 18: Data Storage and Retrieval -- Recipe 18-1: Parsing HTML -- Technologies Used -- Concepts -- Potential Pitfalls -- Structure -- Recipe -- Invocation -- Summary -- Recipe 18-2: CSV Formatting -- Technologies Used -- Concepts -- Potential Pitfalls.

Structure -- Recipe -- Invocation -- Summary -- Chapter 19: Numbers -- Recipe 19-1: The Fibonacci Sequence -- Technologies Used -- Concepts -- Potential Pitfalls -- Structure for Method 1 -- Recipe for Method 1 -- Invocation of Method 1 -- Structure for Method 2 -- Recipes for Method 2 -- Invocations of Method 2 -- Structure for Method 3 -- Recipe for Method 3 -- Invocation of Method 3 -- Summary -- Recipe 19-2: PXE Booting -- Technologies Used -- Concepts -- Potential Pitfalls -- Structure -- Recipe -- Invocation -- Summary -- Chapter 20: Processes -- Recipe 20-1: Process Control -- Technologies Used -- Concepts -- Potential Pitfalls -- Structure -- Recipe -- Invocation -- Summary -- Chapter 21: Internationalization -- Recipe 21-1: Internationalization -- Technologies Used -- Concepts -- Potential Pitfalls -- Structure -- Recipe -- Invocation -- Summary -- Part IV: Reference -- Appendix: Further Reading -- Shell Tutorials and Documentation -- Arrays -- Tools -- Unix Flavors -- Shell Services -- Glossary -- Index -- Advertisement.
Abstract:
A compendium of shell scripting recipes that can immediately be used, adjusted, and applied The shell is the primary way of communicating with the Unix and Linux systems, providing a direct way to program by automating simple-to-intermediate tasks. With this book, Linux expert Steve Parker shares a collection of shell scripting recipes that can be used as is or easily modified for a variety of environments or situations. The book covers shell programming, with a focus on Linux and the Bash shell; it provides credible, real-world relevance, as well as providing the flexible tools to get started immediately. Shares a collection of helpful shell scripting recipes that can immediately be used for various of real-world challenges Features recipes for system tools, shell features, and systems administration Provides a host of plug and play recipes for to immediately apply and easily modify so the wheel doesn't have to be reinvented with each challenge faced Come out of your shell and dive into this collection of tried and tested shell scripting recipes that you can start using right away!.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Electronic Access:
Click to View
Holds: Copies: