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
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Linux Shell Scripting Essentials

You're reading from   Linux Shell Scripting Essentials Learn shell scripting to solve complex shell-related problems and to efficiently automate your day-to-day tasks

Arrow left icon
Product type Paperback
Published in Nov 2015
Publisher
ISBN-13 9781785284441
Length 282 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Table of Contents (10) Chapters Close

Preface 1. The Beginning of the Scripting Journey FREE CHAPTER 2. Getting Hands-on with I/O, Redirection Pipes, and Filters 3. Effective Script Writing 4. Modularizing and Debugging 5. Customizing the Environment 6. Working with Files 7. Welcome to the Processes 8. Scheduling Tasks and Embedding Languages in Scripts Index

What this book covers

Chapter 1, The Beginning of the Scripting Journey, tells you about the importance of writing shell scripts along with a simple Hello World shell script program. It also covers the basic and essential shell script topics such as defining a variable, built-in variables, and operators. It also contains a detailed explanation of shell expansion that occurs with characters such as ~, *, ?, [], and {}.

Chapter 2, Getting Hands-on with I/O, Redirection Pipes, and Filters, talks about the standard input, output, and error streams for a command and shell script. It also has instructions on how to redirect them to other streams. One of the most powerful concepts, namely regular expressions, is also covered. It serves as instructions to commands such as grep, sed, uniq, and tail for filtering useful data from input data.

Chapter 3, Effective Script Writing, provides an insight into structuring shell scripts to organize tasks. After talking about script exit codes, it talks about basic programming constructs such as conditionals and loops. It then goes on to discuss the organization of code into functions and aliases. Finally, it wraps up with details on how xargs, pushd, and popd works.

Chapter 4, Modularizing and Debugging, talks about making shell scripts modular by using common code that can be sourced. It also covers the details of command line arguments to scripts and how one can debug their scripts when they malfunction. This chapter also contains information on how the user can implement custom command completion.

Chapter 5, Customizing the Environment, moves on to talk about the shell environment - what it contains, its significance, and finally how to modify it. It also takes the reader through the different initialization files that bash uses at startup. Finally, we talk about how to check command history and manage running tasks.

Chapter 6, Working with Files, talks about files, which are the entities that most of any UNIX system is composed of. It covers the basic philosophy of "everything is a file" and takes the reader through basic file operations, comparing files, finding them, and creating links. This chapter then explains what special files and temporary files are, and the details involved in file permissions.

Chapter 7, Welcome to the Processes, talks about executable files that come aliveā€”and become processes. From listing and monitoring running processes, it goes on to talk about how to exploit process substitution. Next, it covers process scheduling priorities, signals, traps, and how processes can communicate with each other.

Chapter 8, Scheduling Tasks and Embedding Languages in Scripts, discusses scheduling tasks at appropriate times by using the system Cron. Next, it covers systems that are responsible for orchestrating startup tasks in most modern Linux systems. Finally, this chapter contains instructions on how to embed scripts from other scripting languages into a shell script.

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