Price 4,228 ILS

DURATION 2 Days

Course Overview

This course teaches how to create and debug shell scripts, sed, awk, interactive scripts and signals and how to combine and use this information in scripts that make using Linux so simple. Linux Shell Scripting demonstrates the power of Linux and shows how the different parts of the operating system link together. This course is a must, however you use Linux.

Who should attend?

Anyone needing detailed knowledge of the Linux shell and scripting. Also recommended for anyone using Linux.

Prerequisite:

Introduction to Linux or Linux Fundamentals or equivalent. Linux system administration or equivalent.

Course Outline:

1. Introduction

• The shell
• Common shells – bash, sh, ksh, csh, tcsh
• Shell building blocks
• Initialization files
• Building blocks
• Some sample scripts

2. Writing and debugging scripts

• Creating and running a script
• Script basics
• Debugging scripts
3. The Bash environment
• Shell initialization files
• Variables
• Quotes
• Arithmetic
• Aliases
• Expansion and substitution

4. Regular expressions

• Using regular expressions
• Metacharacters
• Finding patterns

5. Conditional statements

• If
• Using a command’s exit status
• If/then/else and if/then/elif/else
• Nested if statements
• Boolean expressions
• The case statement

 

6. The sed stream editor

• Introduction
• Interactive use
• Regular expressions and stream editing
• Using sed in scripts

7. The awk utility

• What is (g)awk?
• Interactive use
• Formatting text with awk
• Regular expressions with awk
• Awk in scripts

8. Writing interactive scripts

• Prompting for user input
• Reading user input
• Using file descriptors

9. Iterations

• For, while and until loops
• Break and continue
• Select

10. More variables

• Arrays
• Read-only
• Set

11. Functions

• Creating functions
• Passing arguments
• When to use functions

12. Signals

• What are signals?
• Catching signals with trap
• Disable user interrupts

13. Summary