封面
版权页
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files eBooks discount offers and more
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Chapter 1. What and Why of Scripting with Bash
Bash vulnerabilities
The bash command hierarchy
Preparing text editors for scripting
Creating and executing scripts
Debugging your scripts
Summary
Chapter 2. Creating Interactive Scripts
Using echo with options
Basic script using read
Script comments
Enhancing scripts with read prompts
Limiting the number of entered characters
Controlling the visibility of entered text
Enhancing learning with simple scripts
Summary
Chapter 3. Conditions Attached
Simple decision paths using command-line lists
Verifying user input with lists
Using the test shell builtin
Creating conditional statements using if
Extending if with else
More conditions with elif
Using case statements
Script – building a front-end with grep
Summary
Chapter 4. Creating Code Snippets
Abbreviations
Using code snippets
Summary
Chapter 5. Alternative Syntax
Recapping test
Providing parameter defaults
When in doubt – Quote!
Advanced test using [[
Arithmetic operations using ((
Summary
Chapter 6. Iterating with Loops
For loops
Controlling the loop
Reading input from files
Creating operator menus
Summary
Chapter 7. Creating Building Blocks with Functions
Introducing functions
Passing parameters to functions
Returning values from functions
Using functions in menus
Summary
Chapter 8. Introducing sed
Using grep to display text
Using regular expressions
Understanding the basics of sed
Summary
Chapter 9. Automating Apache Virtual Hosts
Apache name-based Virtual Hosts
Automating Virtual Host creation
Summary
Chapter 10. Awk Fundamentals
The history behind awk
Displaying and filtering content from files
Formatting output
Further filtering to display users by UID
Awk control files
Summary
Chapter 11. Summarizing Logs with Awk
The HTTPD log file format
Displaying data from web logs
Displaying the highest ranking IP address
Displaying the browser data
Working with e-mail logs
Summary
Chapter 12. A Better lastlog with Awk
Using awk ranges to exclude data
Conditions based on the number of fields
Manipulating the awk record separator to report on XML data
Summary
Chapter 13. Using Perl as a Bash Scripting Alternative
What is Perl?
Hello World
Perl arrays
Conditional statements in Perl
Using functions within Perl
Summary
Chapter 14. Using Python as a Bash Scripting Alternative
What is Python?
Saying Hello World the Python way
Pythonic arguments
Significant whitespace
Reading user input
Summary
Index
更新时间:2021-07-30 09:41:07