Linux Shell Scripting Bootcamp

A quick and straightforward approach to writing shell scripts to accomplish different types of tasks on a Linux system.
Preview in Mapt

Linux Shell Scripting Bootcamp

James Kent Lewis

4 customer reviews
A quick and straightforward approach to writing shell scripts to accomplish different types of tasks on a Linux system.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$22.40
RRP $31.99
Save 29%
Print + eBook
$39.99
RRP $39.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$22.40
$39.99
$29.99 p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Linux Shell Scripting Bootcamp Book Cover
Linux Shell Scripting Bootcamp
$ 31.99
$ 22.40
Linux: Powerful Server Administration Book Cover
Linux: Powerful Server Administration
$ 79.99
$ 56.00
Buy 2 for $35.00
Save $76.98
Add to Cart

Book Details

ISBN 139781787281103
Paperback208 pages

Book Description

Linux Shell Scripting Bootcamp is all about learning the essentials of script creation, validating parameters, and checking for the existence of files and other items needed by the script.

We will use scripts to explore iterative operations using loops and learn different types of loop statements, with their differences. Along with this, we will also create a numbered backup script for backup files.

Further, you will get well-versed with how variables work on a Linux system and how they relate to scripts. You’ll also learn how to create and call subroutines in a script and create interactive scripts. The most important archive commands, zip and tar, are also discussed for performing backups. Later, you will dive deeper by understanding the use of wget and curl scripts and the use of checksum and file encryption in further chapters.

Finally, you will learn how to debug scripts and scripting best practices that will enable you to write a great code every time! By the end of the book, you will be able to write shell scripts that can dig data from the web and process it efficiently.

Table of Contents

Chapter 1: Getting Started with Shell Scripting
Getting started
Demonstrating the use of scripts
Summary
Chapter 2: Working with Variables
Using variables in scripts
Validating parameters using conditional statements
Comparison operators for strings
Environment variables
Summary
Chapter 3: Using Loops and the sleep Command
Using loops
Screen manipulation
Indenting your code
Using the for statement
Leaving a loop early
The sleep command
Watching a process
Creating numbered backup files
Summary
Chapter 4: Creating and Calling Subroutines
Clearing the screen
File redirection
Command piping
Subroutines
Using parameters
Making a current backup of your work
Summary
Chapter 5: Creating Interactive Scripts
Chapter 5 - Script 1
Summary
Chapter 6: Automating Tasks with Scripts
Chapter 6 - Script 1
Summary
Chapter 7: Working with Files
Writing files
Reading files
Reading and writing files
Reading and writing files interactively
File checksums
File encryption
Summary
Chapter 8: Working with wget and curl
Introducing the wget program
wget and recursion
wget options
curl
Summary
Chapter 9: Debugging Scripts
Syntax errors
Automatic backups
More syntax errors
Logic errors
Using set to debug scripts
Summary
Chapter 10: Scripting Best Practices
Verifying backups
ssh and scp
Find and use a good text editor
Environment variables and aliases
ssh prompt
Testing an archive
Progress indicator
Creating new commands from a template
Alerting the user
Summary

What You Will Learn

  • Get acquainted with the basics of a shell script to serve as a refresher for more advanced topics
  • Learn different ways to create and run a script
  • Discuss the passing and verification of parameters, along with the verification of other items.
  • Understand the different forms of conditions and loops, and go over the sleep command in detail
  • Learn about different ways to handle the reporting of return codes
  • Create an interactive script by reading the keyboard and use subroutines and interrupts
  • Create scripts to perform backups and go over the use of encryption tools and checksums
  • Use wget and curl in scripts to get data directly from the Internet

Authors

Table of Contents

Chapter 1: Getting Started with Shell Scripting
Getting started
Demonstrating the use of scripts
Summary
Chapter 2: Working with Variables
Using variables in scripts
Validating parameters using conditional statements
Comparison operators for strings
Environment variables
Summary
Chapter 3: Using Loops and the sleep Command
Using loops
Screen manipulation
Indenting your code
Using the for statement
Leaving a loop early
The sleep command
Watching a process
Creating numbered backup files
Summary
Chapter 4: Creating and Calling Subroutines
Clearing the screen
File redirection
Command piping
Subroutines
Using parameters
Making a current backup of your work
Summary
Chapter 5: Creating Interactive Scripts
Chapter 5 - Script 1
Summary
Chapter 6: Automating Tasks with Scripts
Chapter 6 - Script 1
Summary
Chapter 7: Working with Files
Writing files
Reading files
Reading and writing files
Reading and writing files interactively
File checksums
File encryption
Summary
Chapter 8: Working with wget and curl
Introducing the wget program
wget and recursion
wget options
curl
Summary
Chapter 9: Debugging Scripts
Syntax errors
Automatic backups
More syntax errors
Logic errors
Using set to debug scripts
Summary
Chapter 10: Scripting Best Practices
Verifying backups
ssh and scp
Find and use a good text editor
Environment variables and aliases
ssh prompt
Testing an archive
Progress indicator
Creating new commands from a template
Alerting the user
Summary

Book Details

ISBN 139781787281103
Paperback208 pages
Read More
From 4 reviews

Read More Reviews

Recommended for You

Linux: Powerful Server Administration Book Cover
Linux: Powerful Server Administration
$ 79.99
$ 56.00
Mastering Embedded Linux Programming - Second Edition Book Cover
Mastering Embedded Linux Programming - Second Edition
$ 39.99
$ 28.00
SQL Server on Linux Book Cover
SQL Server on Linux
$ 31.99
$ 22.40
Embedded Linux Development using Yocto Projects - Second Edition Book Cover
Embedded Linux Development using Yocto Projects - Second Edition
$ 27.99
$ 19.60
Mastering Linux Security and Hardening Book Cover
Mastering Linux Security and Hardening
$ 35.99
$ 25.20
DevOps: Puppet, Docker, and Kubernetes Book Cover
DevOps: Puppet, Docker, and Kubernetes
$ 79.99
$ 56.00