Mastering Linux Shell Scripting
eBook - ePub

Mastering Linux Shell Scripting

  1. 284 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering Linux Shell Scripting

About this book

Master the complexities of Bash shell scripting and unlock the power of shell for your enterpriseAbout This Book• Identify high-level steps such as verifying user input• Using the command line and conditional statements in creating/executing simple shell scripts• Create and edit dynamic shell scripts to manage complex and repetitive tasks• Leverage the command-line to bypass GUI and automate common tasksWho This Book Is ForIf you are a Linux administrator or a system administrator and are interested in automating tasks in your daily lives, saving time and effort, this book is for you. Basic shell scripting and command-line experience will be required. Familiarity with the tasks you need to automate will be helpful.What You Will Learn• Make, execute, and debug your first Bash script• Create interactive scripts that prompt for user input• Foster menu structures for operators with little command-line experience• Develop scripts that dynamically edit web configuration files to produce a new virtual host • Write scripts that use AWK to search and reports on log files• Draft effective scripts using functions as building blocks, reducing maintenance and build time• Make informed choices by comparing different script languages such as Python with BASHIn DetailIn this book, you'll discover everything you need to know to master shell scripting and make informed choices about the elements you employ.Grab your favorite editor and start writing your best Bash scripts step by step. Get to grips with the fundamentals of creating and running a script in normal mode, and in debug mode. Learn about various conditional statements' code snippets, and realize the power of repetition and loops in your shell script. You will also learn to write complex shell scripts. This book will also deep dive into file system administration, directories, and system administration like networking, process management, user authentications, and package installation and regular expressions. Towards the end of the book, you will learn how to use Python as a BASH Scripting alternative. By the end of this book, you will know shell scripts at the snap of your fingers and will be able to automate and communicate with your system with keyboard expressions.Style and approachThe book will capture your attention and keep you engaged with the simplicity and clarity of each explanation. Every step is accompanied by screenshots so you can cross-check the results before moving on.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

Contributors

About the authors

Mokhtar Ebrahim started working as a Linux system administrator in 2010. He is responsible for maintaining, securing, and troubleshooting Linux servers for multiple clients around the world. He loves writing shell and Python scripts to automate his work. He writes technical articles on the Like Geeks website about Linux, Python, web development, and server administration. He is a father to a beautiful girl and a husband to a faithful wife.
I would like to thank my wife for helping me with all her efforts to finish this book. Thank you, Doaa, for being a part of that. Also, I would like to thank everyone at Packt for working with me to make sure the book is released. Last but not least, I'd like to thank Brian Fox, the author of the bash shell, for creating such an awesome piece of software; without it, such a book would not exist.
Andrew Mallett is the owner of The Urban Penguin, and he is a comprehensive provider of professional Linux software development, training, and services. Having always been a command-line fan, he feels that so much time can be saved through knowing command-line shortcuts and scripting. TheUrbanPenguin YouTube channel, maintained by Andrew, has well over 800 videos to support this, and he has authored four other Packt titles.

About the reviewer

Sebastiaan Tammer is a Linux enthusiast from The Netherlands. After attaining his BSc in Information Sciences, he graduated with MSc in Business Informatics, both from Utrecht University. His professional career started in Java development before he pivoted into Linux.
He has worked on number of technologies...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. Packt Upsell
  4. Contributors
  5. Preface
  6. The What and Why of Scripting with Bash
  7. Creating Interactive Scripts
  8. Conditions Attached
  9. Creating Code Snippets
  10. Alternative Syntax
  11. Iterating with Loops
  12. Creating Building Blocks with Functions
  13. Introducing the Stream Editor
  14. Automating Apache Virtual Hosts
  15. AWK Fundamentals
  16. Regular Expressions
  17. Summarizing Logs with AWK
  18. A Better lastlog with AWK
  19. Using Python as a Bash Scripting Alternative
  20. Assessments
  21. Other Books You May Enjoy

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Mastering Linux Shell Scripting by Mokhtar Ebrahim, Andrew Mallett in PDF and/or ePUB format, as well as other popular books in Computer Science & Operating Systems. We have over one million books available in our catalogue for you to explore.