By Anarkia333 |
2018
284

Master the complexities of Bash shell scripting and unlock the power of shell for your enterprise

Key Features
Identify high-level steps such as verifying user input
Use the command line and conditional statements for creating and executing simple shell scripts
Create and edit dynamic shell scripts to manage complex and repetitive tasks

Book Description
Mastering shell scripting is made easy with this book that guides you through everything, right from using the Linux command line through to creating Bash scripts, while also helping you make informed choices about the elements you employ.

You can use your favorite editor and start writing Bash scripts in a step-by-step manner. The book will also help you get to grips with the fundamentals of creating and running a script in normal mode, as well as in debug mode. You'll explore code snippets from various conditional statements, and realize the power of repetition and loops in your shell script. You will gradually learn to write complex shell scripts, before delving into file system administration, directories, and system administration such as networking, process management, user authentication, package installation, and regular expressions. Toward the concluding chapters, you will learn how to use Python as an alternative for Bash scripting.

By the end of this book, you will be well-versed with shell scripts and have mastered the technique of automating and communicating with your system through keyboard expressions.

What you will learn

  • Develop, execute, and debug your first Bash script
    Create interactive scripts that prompt for user input
    Build 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 log files and generate reports
    Draft effective scripts using functions as building blocks, reducing maintenance and build time
    Compare different script languages such as Python with Bash
    Use the command line to bypass the graphical user interface (GUI) and automate common tasks
    Who This Book Is For

If you are a Linux administrator or a system administrator and are interested in automating daily tasks to save time and effort, then this book is for you. Basic shell scripting and command-line experience will be required. Familiarity with the tasks you need to automate will also be helpful.

  • Table of Contents
    What and Why of Scripting with BASH
    Creating Interactive Scripts
    Conditions attached
    Creating Code Snippets
    Alternative syntax
    Iterating with Loops
    Creating Building Blocks with Functions
    Introducing sed
    Automating Apache Virtual Hosts
    AWK Fundamentals
    Regular expressions
    Summarizing Logs with awk
    A Better lastlog with Awk
    Using Python as a BASH Scripting Alternative