Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Linux Shell Scripting

You're reading from   Learning Linux Shell Scripting Leverage the power of shell scripts to solve real-world problems

Arrow left icon
Product type Paperback
Published in May 2018
Publisher Packt
ISBN-13 9781788993197
Length 332 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ganesh Sanjiv Naik Ganesh Sanjiv Naik
Author Profile Icon Ganesh Sanjiv Naik
Ganesh Sanjiv Naik
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Getting Started and Working with Shell Scripting 2. Drilling Deep into Process Management, Job Control, and Automation FREE CHAPTER 3. Using Text Processing and Filters in Your Scripts 4. Working with Commands 5. Exploring Expressions and Variables 6. Neat Tricks with Shell Scripting 7. Performing Arithmetic Operations in Shell Scripts 8. Automating Decision-Making in Scripts 9. Automating Repetitive Tasks 10. Working with Functions 11. Using Advanced Functionality in Scripts 12. System Startup and Customizing a Linux System 13. Pattern Matching and Regular Expressions with sed and awk 14. Taking Backup and Embedding Other Languages in Shell Scripts 15. Database Administration Using Shell Scripts 16. Other Books You May Enjoy

What this book covers

Chapter 1, Getting Started and Working with Shell Scripting, introduces different ways to write and run shell scripts. We'll also learn ways to handle files and directories, as well as working with permissions.

Chapter 2, Drilling Deep into Process Management, Job Control, and Automation, speaks about basic process management. We will learn about command ps and also about job management using commands such as jobs, fg, bg, kill, and pkill. Later on, we will learn about process monitoring tools top, iostat, vmstat, and sar.

Chapter 3, Using Text Processing and Filters in Your Scripts, speaks about using more, less, head, and tail commands. We will also learn about text processing tools such as cut, paste, comm, and uniq. We will learn what is a standard input, output, and standard error. Later on, we will learn about meta-characters and pattern matching using VI and grep.

Chapter 4, Working with Commands, explains how shell interprets any command entered on the command line. We will also learn about command substitution, separators, and pipes in detail.

Chapter 5, Exploring Expressions and Variables, speaks about variables in general and environment variables in particular. This includes how to export environment variables, set, shift, read-only variables, command-line arguments, and create and handle arrays.

Chapter 6, Neat Tricks with Shell Scripting, talks about debugging, here operator, and interactive shell scripts for taking input from keyboard and file handling.

Chapter 7, Performing Arithmetic Operations in Shell Scripts, covers performing arithmetic operations in various ways such as using declare, let, expr, and arithmetic expressions. We will also learn about representing numbers in different bases such as hex, octal, and binary. The chapter also covers using bc utility for performing floating point or fractional arithmetic.

Chapter 8, Automating Decision Making in Scripts, talks about using decision making in scripts by working with Test, if-else, and switching case. We will also learn about how to use select with for loop along with the menu.

Chapter 9, Automating Repetitive Tasks, speaks about repeating tasks such as doing routine administration activities using the for loop, while loop, and do while loop. We will also learn how control loops using break statement and continue statement.

Chapter 10, Working with Functions, speaks about functions in shell scripts. We will learn how to define and display functions, and further how to remove the function from the shell. We will also learn about passing arguments to functions, sharing data between functions, declaring local variables in a function, returning result from a function, and running functions in the background. We will finally learn about using source and .(dot) commands. We will use these commands for using the library of functions.

Chapter 11, Using Advanced Functionality in Scripts, covers using traps and signals. We will also learn about creating menus with the help of dialog utility.

Chapter 12, System Start-up and Customizing a Linux System, speaks about the Linux system start-up, from power on until user login and how to customize a Linux system environment.

Chapter 13, Pattern Matching and Regular Expressions with sed and awk, talks about regular expressions and using sed (stream editor) and awk for text processing. We will learn how to use various commands and options along with a lot of examples for using sed and awk.

Chapter 14, Taking Backup and Embedding Other Languages in Shell Scripts, speaks about taking backup locally as well as across the network. We will also learn about automating it using crontab. We will learn about embedding other languages in bash scripts such as Python, Ruby, and Pearl.

Chapter 15, Database Administration Using Shell Scripts, talks about how to write and execute MySQL commands in a shell script as well as how to write and execute Oracle commands in a shell script. By using learnings from this chapter, we will be able to automate frequently required database administration tasks.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image