Book Image

Linux Shell Scripting Bootcamp

By : James K Lewis
Book Image

Linux Shell Scripting Bootcamp

By: James K Lewis

Overview of this book

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 (19 chapters)
Linux Shell Scripting Bootcamp
Credits
About the Author
Acknowledgement
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Index

Index

A

  • aliases / Environment variables and aliases
  • archive
    • testing / Testing an archive
  • automatic backups / Automatic backups

B

  • backup
    • creating / Making a current backup of your work, Chapter 4 – Script 7
  • backups
    • verifying / Verifying backups

C

  • code
    • indenting / Indenting your code, Chapter 3 - Script 6
  • command piping / Command piping, Chapter 4 - Script 3
  • commands
    • creating, from template / Creating new commands from a template, Chapter 10 – Script 2
  • comparison operators
    • for strings / Comparison operators for strings, Chapter 2 - Script 3, Chapter 2 - Script 4, Chapter 2 - Script 5
  • Computer Backup Script / Creating numbered backup files
  • conditional statements
    • used, for validating parameters / Validating parameters using conditional statements, Chapter 2 - Script 2
  • cron / Cron
  • crontab / Cron
  • curl options / curl options, Chapter 8 - Script 2
  • curl program / curl

E

  • environment variables / Environment variables , Chapter 2 - Script 6, Chapter 2 - Script 7, Environment variables and aliases

F

  • file checksums / File checksums
  • file encryption / File encryption, Chapter 7 - Script 7
  • file redirection / File redirection
  • files
    • writing / Writing files, Chapter 7 - Script 1, Chapter 7 - Script 5
    • reading / Reading files, Chapter 7 - Script 2, Chapter 7 - Script 3, Chapter 7 - Script 4, Reading and writing files, Chapter 7 - Script 5
    • writing, interactively / Reading and writing files interactively, Chapter 7 - Script 6
    • reading, interactively / Reading and writing files interactively, Chapter 7 - Script 6
  • for statement
    • using / Using the for statement, Chapter 3 - Script 7, Chapter 3 - Script 8

I

  • interactive scripts
    • creating / Chapter 5 - Script 1, Chapter 5 - Script 2, Chapter 5 - Script 3, Chapter 5 - Script 4, Chapter 5 - Script 5, Chapter 5 - Script 6, Chapter 5 - Script 7, Chapter 5 - Script 8
  • Internal Field Separator / Chapter 7 - Script 3
  • Internet service provider (ISP) / ssh and scp

L

  • logic errors / Logic errors, Chapter 9 - Script 4
  • loop
    • using / Using loops, Chapter 3 - Script 1, Chapter 3 - Script 2, Chapter 3 - Script 3
    • leaving / Leaving a loop early, Chapter 3 - Script 9

N

  • numbered backup files
    • creating / Creating numbered backup files, Chapter 3 – Script 13

P

  • parameters
    • validating, conditional statements used / Validating parameters using conditional statements, Chapter 2 - Script 2
    • using / Using parameters, Chapter 4 - Script 5, Chapter 4 - Script 6
  • process
    • watching / Watching a process, Chapter 3 - Script 12
  • progress indicator / Progress indicator, Chapter 10 - Script 1

R

  • recursion / wget and recursion

S

  • scp / ssh and scp
  • screen
    • clearing / Clearing the screen, Chapter 4 - Script 1
  • screen manipulation / Screen manipulation, Chapter 3 - Script 4, Chapter 3 - Script 5
  • scripts
    • demonstrating / Demonstrating the use of scripts, Chapter 1 - Script 1, Chapter 1 - Script 2, Chapter 1 - Script 3, Chapter 1 - Script 4, Chapter 1 - Script 5
    • variable, using in / Using variables in scripts
    • variables, using in / Using variables in scripts, Chapter 2 - Script 1
    • tasks, automating with / Chapter 6 - Script 1, Chapter 6 - Script 2
    • for checking user login / Chapter 6 - Script 3, Chapter 6 - Script 4
    • running, as root / Chapter 6 - Script 5, Chapter 6 - Script 6, Chapter 6 - Script 7
  • set commands
    • used, to debug scripts / Using set to debug scripts, Chapter 9 - Script 5 and Script 6, Chapter 9 - Script 7, Chapter 9 - Script 8, Chapter 9 - Script 9
  • shell scripting
    • about / Getting started
    • text editor, using / Using a good text editor
  • sleep command / The sleep command, Chapter 3 - Script 10, Chapter 3 - Script 11
  • ssh / ssh and scp
  • ssh prompt / ssh prompt
  • subroutines / Subroutines, Chapter 4 - Script 4
  • syntax errors / Syntax errors, Chapter 9 - Script 1, Chapter 9 - Script 2, More syntax errors, Chapter 9 - Script 3

T

  • tasks
    • automating, with scripts / Chapter 6 - Script 1, Chapter 6 - Script 2, Chapter 6 - Script 3
  • text editor
    • finding / Find and use a good text editor
    • using / Find and use a good text editor

U

  • Uniform Resource Locator (URL) / wget options
  • user
    • alerting / Alerting the user

V

  • variables
    • using, in scripts / Using variables in scripts, Chapter 2 - Script 1

W

  • wget configuration files / wget configuration files, Chapter 8 - Script 1
  • wget options / wget options, wget options
  • wget program / Introducing the wget program, wget and recursion
  • wget return codes / wget return codes
  • who command / Chapter 6 - Script 4

Z

  • zip command
    • used, for backing up files / Cron, Chapter 6 - Script 5