Home > Computing and Information Technology > Operating systems > Shell Scripting: Expert Recipes for Linux, Bash, and more
44%
Shell Scripting: Expert Recipes for Linux, Bash, and more

Shell Scripting: Expert Recipes for Linux, Bash, and more

          
5
4
3
2
1

International Edition


Premium quality
Premium quality
Bookswagon upholds the quality by delivering untarnished books. Quality, services and satisfaction are everything for us!
Easy Return
Easy return
Not satisfied with this product! Keep it in original condition and packaging to avail easy return policy.
Certified product
Certified product
First impression is the last impression! Address the book’s certification page, ISBN, publisher’s name, copyright page and print quality.
Secure Checkout
Secure checkout
Security at its finest! Login, browse, purchase and pay, every step is safe and secured.
Money back guarantee
Money-back guarantee:
It’s all about customers! For any kind of bad experience with the product, get your actual amount back after returning the product.
On time delivery
On-time delivery
At your doorstep on time! Get this book delivered without any delay.
Quantity:
Add to Wishlist

About the Book

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!

Table of Contents:
Introduction xxix Part I: About the Ingredients Chapter 1: The History of Unix, Gnu, and Linux 3 Unix 3 “Everything is a File” and Pipelines 5 BSD 6 GNU 7 Linux 11 Summary 12 Chapter 2: Getting Started 15 Choosing an OS 15 GNU/Linux 15 The BSDs 17 Proprietary Unix 17 Microsoft Windows 17 Choosing an Editor 18 Graphical Text Editors 18 Terminal Emulation 21 Nongraphical Text Editors 22 Setting Up the Environment 24 The Shell Profile 24 Aliases 26 vim Settings 30 Summary 31 Chapter 3: Variables 33 Using Variables 33 Typing 34 Assigning Values to Variables 35 Positional Parameters 39 Return Codes 42 Unsetting Variables 45 Preset and Standard Variables 47 BASH_ENV 47 BASHOPTS 47 SHELLOPTS 48 BASH_COMMAND 50 BASH_SOURCE, FUNCNAME, LINENO, and BASH_LINENO 51 SHELL 55 HOSTNAME and HOSTTYPE 55 Working Directory 55 PIPESTATUS 55 TIMEFORMAT 56 PPID 57 RANDOM 58 REPLY 58 SECONDS 58 BASH_XTRACEFD 59 GLOBIGNORE 60 HOME 62 IFS 62 PATH 63 TMOUT 64 TMPDIR 65 User Identification Variables 65 Summary 66 Chapter 4: Wildcard Expansion 67 Filename Expansion (Globbing) 67 Bash Globbing Features 70 Shell Options 71 Regular Expressions and Quoting 75 Overview of Regular Expressions 76 Quoting 77 Summary 81 Chapter 5: Conditional Execution 83 If/Then 83 Else 85 elif 85 Test ([) 87 Flags for Test 88 File Comparison Tests 95 String Comparison Tests 96 Regular Expression Tests 98 Numerical Tests 101 Combining Tests 103 Case 105 Summary 109 Chapter 6: Flow Control Using Loops 111 For Loops 111 When to Use for Loops 112 Imaginative Ways of Feeding “for” with Data 112 C-Style for Loops 118 while Loops 119 When to Use while Loops 119 Ways to Use while Loops 119 Nested Loops 125 Breaking and Continuing Loop Execution 126 while with Case 130 until Loops 131 select Loops 133 Summary 137 Chapter 7: Variables Continued 139 Using Variables 139 Variable Types 141 Length of Variables 142 Special String Operators 144 Stripping Variable Strings by Length 144 Stripping from the End of the String 146 Stripping Strings with Patterns 147 Searching Strings 151 Using Search and Replace 151 Replacing Patterns 153 Deleting Patterns 153 Changing Case 153 Providing Default Values 153 Indirection 157 Sourcing Variables 158 Summary 159 Chapter 8: Functions and Libraries 161 Functions 161 Defining Functions 162 Function Output 162 Writing to a File 164 Redirecting the Output of an Entire Function 167 Functions with Trap 171 Recursive Functions 173 Variable Scope 177 Libraries 181 Creating and Accessing Libraries 183 Library Structures 183 Network Configuration Library 187 Use of Libraries 191 getopts 191 Handling Errors 194 getopts within Functions 195 Summary 197 Chapter 9: Arrays 199 Assigning Arrays 199 One at a Time 200 All at Once 200 By Index 201 All at Once from a Source 201 Read from Input 203 Accessing Arrays 205 Accessing by Index 205 Length of Arrays 206 Accessing by Variable Index 206 Selecting Items from an Array 209 Displaying the Entire Array 209 Associative Arrays 210 Manipulating Arrays 211 Copying an Array 211 Appending to an Array 213 Deleting from an Array 214 Advanced Techniques 216 Summary 217 Chapter 10: Processes 219 The ps Command 219 ps Line Length 220 Parsing the Process Table Accurately 220 killall 223 The /proc pseudo-filesystem 225 prtstat 226 I/O Redirection 227 Appending Output to an Existing File 229 Permissions on Redirections 229 exec 229 Using exec to Replace the Existing Program 230 Using exec to Change Redirection 231 Pipelines 237 Background Processing 237 wait 238 Catching Hangups with nohup 239 Other Features of /proc and /sys 242 Version 242 SysRq 242 /proc/meminfo 245 /proc/cpuinfo 245 /sys 246 /sys/devices/system/node 251 sysctl 253 Summary 254 Chapter 11: Choosing and Using Shells 255 The Bourne Shell 256 The KornShell 256 The C Shell 256 The Tenex C Shell 257 The Z Shell 257 The Bourne Again Shell 257 The Debian Almquist Shell 258 Dotfiles 258 Interactive Login Shells 259 Interactive Non-Login Shells 260 Non-Interactive Shells 261 Logout Scripts 262 Command Prompts 262 The PS1 Prompt 262 The PS2, PS3, and PS4 Prompts 264 Aliases 265 Timesavers 265 Modifying Behaviors 265 History 266 Recalling Commands 267 Searching History 267 Timestamps 268 Tab Completion 269 ksh 269 tcsh 270 zsh 270 bash 271 Foreground, Background, and Job Control 272 Backgrounding Processes 272 Job Control 273 nohup and disown 275 Summary 276 Part II: Recipes For Using and Extending System Tools Chapter 12: File Manipulation 279 stat 279 cat 281 Numbering Lines 282 Dealing with Blank Lines 282 Non-Printing Characters 283 cat Backwards is tac 284 Redirection 285 Redirecting Output: The Single Greater-Than Arrow (>) 285 Appending: The Double Greater-Than Arrow (>>) 286 Input Redirection: The Single Less-Than Arrow (<) 288 Here Documents: The Double Less-Than Arrow (<< EOF) 290 dd 292 df 294 mktemp 295 join 297 install 298 grep 300 grep Flags 300 grep Regular Expressions 301 split 303 tee 304 touch 306 find 307 find-exec 310 Summary 313 Chapter 13: Text Manipulation 315 cut 315 echo 316 dial1 316 dial2 319 fmt 320 head and tail 323 Prizes 323 World Cup 324 od 328 paste 331 pr 334 printf 335 shuf 337 Dice Thrower 337 Card Dealer 338 Travel Planner 340 sort 341 Sorting on Keys 342 Sorting Log Files by Date and Time 344 Sorting Human-Readable Numbers 345 tr 346 uniq 350 wc 351 Summary 352 Chapter 14: Tools For Systems Administration 353 basename 353 date 355 Typical Uses of date 355 More Interesting Uses of date 359 dirname 360 factor 362 identity, groups, and getent 364 logger 367 md5sum 368 mkfi fo 370 Master and Minions 371 Reversing the Order 373 Networking 375 telnet 376 netcat 376 ping 378 Scripting ssh and scp 381 OpenSSL 383 nohup 390 seq 391 Integer Sequences 391 Floating Point Sequences 393 sleep 394 timeout 394 Shutdown Script 396 Network Timeout 399 uname 400 uuencode 401 xargs 402 yes 405 Summary 406 Part III: Recipes For Systems Administration Chapter 15: Shell Features 409 Recipe 15-1: Installing Init Scripts 409 Technologies Used 410 Concepts 410 Potential Pitfalls 410 Structure 410 Recipe 412 Invocation 414 Summary 414 Recipe 15-2: RPM Report 414 Technologies Used 415 Concepts 415 Potential Pitfalls 415 Structure 415 Recipe 417 Invocation 419 Summary 420 Recipe 15-3: Postinstall Scripts 421 Technologies Used 421 Concepts 421 Potential Pitfalls 422 Structure 422 Recipe 423 Invocation 425 Summary 426 Chapter 16: Systems Administration 427 Recipe 16-1: init Scripts 427 Technologies Used 428 Concepts 428 Potential Pitfalls 429 Structure 430 Recipe 431 Invocation 432 Summary 433 Recipe 16-2: CGI Scripts 433 Technologies Used 433 Concepts 434 Potential Pitfalls 434 Structure 435 Recipe 438 Invocation 441 Summary 445 Recipe 16-3: Configuration Files 445 Technologies Used 445 Concepts 445 Potential Pitfalls 446 Structure 446 Recipe 446 Invocation 447 Summary 448 Recipe 16-4: Locks 448 Technologies Used 448 Concepts 448 Potential Pitfalls 449 Structure 450 Recipe 453 Invocation 455 Summary 458 Chapter 17: Presentation 459 Recipe 17-1: Space Game 459 Technologies Used 459 Concepts 460 Potential Pitfalls 462 Structure 462 Recipe 464 Invocation 469 Summary 470 Chapter 18: Data Storage and Retrieval 471 Recipe 18-1: Parsing HTML 471 Technologies Used 471 Concepts 472 Potential Pitfalls 472 Structure 472 Recipe 473 Invocation 474 Summary 476 Recipe 18-2: CSV Formatting 476 Technologies Used 476 Concepts 476 Potential Pitfalls 477 Structure 477 Recipe 478 Invocation 480 Summary 481 Chapter 19: Numbers 483 Recipe 19-1: The Fibonacci Sequence 483 Technologies Used 483 Concepts 484 Potential Pitfalls 484 Structure for Method 1 485 Recipe for Method 1 486 Invocation of Method 1 486 Structure for Method 2 487 Recipes for Method 2 488 Invocations of Method 2 489 Structure for Method 3 490 Recipe for Method 3 490 Invocation of Method 3 491 Summary 492 Recipe 19-2: PXE Booting 492 Technologies Used 492 Concepts 493 Potential Pitfalls 493 Structure 493 Recipe 494 Invocation 497 Summary 499 Chapter 20: Processes 501 Recipe 20-1: Process Control 501 Technologies Used 501 Concepts 502 Potential Pitfalls 503 Structure 503 Recipe 506 Invocation 511 Summary 516 Chapter 21: Internationalization 517 Recipe 21-1: Internationalization 517 Technologies Used 518 Concepts 518 Potential Pitfalls 519 Structure 520 Recipe 521 Invocation 525 Summary 526 Part IV: Reference Appendix: Further Reading 529 Shell Tutorials and Documentation 529 Arrays 530 Tools 530 Unix Flavors 531 Shell Services 531 Glossary 533 Index 539


Best Sellers


Product Details
  • ISBN-13: 9781118024485
  • Publisher: John Wiley & Sons Inc
  • Publisher Imprint: Wrox Press
  • Depth: 32
  • Language: English
  • Returnable: N
  • Series Title: English
  • Sub Title: Expert Recipes for Linux, Bash, and more
  • Width: 188 mm
  • ISBN-10: 1118024486
  • Publisher Date: 26 Aug 2011
  • Binding: Paperback
  • Height: 236 mm
  • No of Pages: 608
  • Returnable: N
  • Spine Width: 29 mm
  • Weight: 1051 gr


Similar Products

How would you rate your experience shopping for books on Bookswagon?

Add Photo
Add Photo

Customer Reviews

REVIEWS           
Click Here To Be The First to Review this Product
Shell Scripting: Expert Recipes for Linux, Bash, and more
John Wiley & Sons Inc -
Shell Scripting: Expert Recipes for Linux, Bash, and more
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

Shell Scripting: Expert Recipes for Linux, Bash, and more

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book
    Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept

    New Arrivals

    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!
    ASK VIDYA