Linux

Bash Programming (LNX411)

Course Length: 3 days

This 3-day Bash Programming training class provides a thorough introduction to bash programming by covering topics like shell variables and functions, the login process, using arrays with loops, and debugging techniques such that by the end of the course, students will be able to take full advantage of the bash shell.

Bash Programming

Register or Request Training

  • Private class for your team
  • Live expert instructor
  • Online or on‑location
  • Customizable agenda
  • Proposal turnaround within 1–2 business days

Course Overview

This 3-day Bash Programming training class provides a thorough introduction to bash programming by covering topics like shell variables and functions, the login process, using arrays with loops, and debugging techniques such that by the end of the course, students will be able to take full advantage of the bash shell. This course is intended for Linux or UNIX users, programmers, and system administrators.

Course Benefits

  • Understand the foundational concepts of UNIX processes, including process management and the use of system utilities like the ps command.
  • Develop a solid understanding of the UNIX shell environment, including how to run scripts and manage shell variables.
  • Learn how to effectively manage user login processes and environment scripts to optimize the UNIX user experience.
  • Master conditional statements and loops to automate tasks and manipulate data efficiently within the UNIX system.
  • Gain detailed knowledge on special shell variables and how to utilize them in scripting for advanced task management.
  • Enhance your scripting abilities by understanding quoting mechanisms and their applications in securing text processing tasks.
  • Acquire skills in defining and using shell functions, passing arguments, and returning values to streamline complex tasks.
  • Explore advanced programming concepts like shell arithmetic and terminal independence to create robust scripts.
  • Learn debugging techniques that include script tracing and conditional debugging to enhance the reliability of scripts.
  • Benefit from practical, hands-on exercises that reinforce learning and application of shell scripting in real-world scenarios.

Delivery Methods

Course Outline

  1. Course Introduction
    1. Course Objectives
    2. Course Overview
    3. Using the Workbook
    4. Suggested References and Reading
  2. UNIX Processes
    1. What is a Process?
    2. Process Structure
    3. The ps Utility
    4. Options to the ps Utility
    5. Background Commands (&)
    6. Killing Background Processes
    7. Redirecting the Standard Error
  3. Getting Started
    1. What is a Shell?
    2. Running Scripts
    3. Specifying the Script's Interpreter
    4. The PATH Environment Variable
    5. Sub-shells
  4. Variables
    1. Shell Variables
    2. The read Command
    3. The export Command
    4. The Shell Environment
    5. Parameter Expansion
    6. Command Substitution
  5. The Login Process
    1. The Login Process
    2. The System Profile Script
    3. Your .bash_profile Script
    4. The . Command
  6. Conditional Statements
    1. The Exit Status of Commands
    2. Command Line Examples
    3. The test Command
    4. The if-then-else Construct
    5. The elif Construct
    6. case Statements
  7. Loops
    1. The for Loop
    2. The while Loop
    3. break and continue
    4. Reading Lines From Files
    5. Using Arrays with Loops
  8. Special Variables
    1. $$ - PID of Shell
    2. Command-Line Arguments
    3. $# - Number of Arguments
    4. $* - All Arguments
    5. The shift Command
    6. The set Command
    7. Getting Options
  9. Quoting Mechanisms
    1. Single vs. Double Quotes
    2. What is a Here Document?
    3. Using a Here Document
    4. Here Document Quoting
    5. Ignoring Leading Tabs
  10. Functions
    1. Shell Functions
    2. Passing Arguments to Functions
    3. Returning Values from Functions
    4. Function Declarations
  11. Advanced Programming
    1. Shell Arithmetic
    2. The select Statement
    3. Terminal Independence in Scripts
    4. The eval Command
  12. Debugging Techniques
    1. Using echo
    2. Using Standard Error
    3. Script Tracing
    4. Options for Debugging
    5. Conditional Debugging

Class Materials

Each student receives a comprehensive set of materials, including course notes and all class examples.

Class Prerequisites

Experience in the following is required for this Linux class:

  • Knowledge of fundamentals of UNIX or Linux.

Have questions about this course?

We can help with curriculum details, delivery options, pricing, or anything else. Reach out and we’ll point you in the right direction.