Linux Shell Scripting Bootcamp

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

Linux Shell Scripting Bootcamp

James Kent Lewis

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.99p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

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

Read More Reviews

Recommended for You

Enterprise PowerShell Scripting Bootcamp Book Cover
Enterprise PowerShell Scripting Bootcamp
$ 35.99
$ 25.20
Linux Shell Scripting Cookbook - Third Edition Book Cover
Linux Shell Scripting Cookbook - Third Edition
$ 39.99
$ 28.00
Linux Shell Scripting Solutions [Video] Book Cover
Linux Shell Scripting Solutions [Video]
$ 89.99
$ 76.50
Learning Linux Shell Scripting Book Cover
Learning Linux Shell Scripting
$ 39.99
$ 28.00
Mastering Linux Shell Scripting Book Cover
Mastering Linux Shell Scripting
$ 27.99
$ 19.60
Linux Shell Scripting Essentials Book Cover
Linux Shell Scripting Essentials
$ 39.99
$ 28.00