Introduction to Bash Programming

8 Ratings

Course Number: LNX-110
Duration: 3 days (19.5 hours)
Format: Live, hands-on

Bash Shell Scripting Training Overview

Accelebrate's Introduction to Bash Shell Scripting course teaches students to read, write, and debug Bash (Bourne Again Shell) scripts.

NOTE: This class can be taught using the Linux distribution of your choice.

Location and Pricing

Accelebrate offers instructor-led enterprise training for groups of 3 or more online or at your site. Most Accelebrate classes can be flexibly scheduled for your group, including delivery in half-day segments across a week or set of weeks. To receive a customized proposal and price quote for private corporate training on-site or online, please contact us.

In addition, some courses are available as live, instructor-led training from one of our partners.

Objectives

  • Understand Unix processes and how to control them
  • Learn how to use and script the Bash shell
  • Master core Bash language constructs such as variables, loops, conditionals, and functions
  • Learn advanced Bash programming techniques
  • Debug Bash scripts

Prerequisites

All students should have basic knowledge of Unix or Linux, or have taken Accelebrate's Introduction to Linux for End Users class. Prior programming or scripting experience is helpful but not required.

Outline

Expand All | Collapse All

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

Training Materials

All attendees receive comprehensive courseware.

Software Requirements

Attendees will not need to install any software on their computers for this class. The class will be conducted in a remote environment that Accelebrate will provide; students will only need a local computer with a web browser and a stable Internet connection. Any recent version of Microsoft Edge, Mozilla Firefox, or Google Chrome will work well.



Learn faster

Our live, instructor-led lectures are far more effective than pre-recorded classes

Satisfaction guarantee

If your team is not 100% satisfied with your training, we do what's necessary to make it right

Learn online from anywhere

Whether you are at home or in the office, we make learning interactive and engaging

Multiple Payment Options

We accept check, ACH/EFT, major credit cards, and most purchase orders



Recent Training Locations

Alabama

Birmingham

Huntsville

Montgomery

Alaska

Anchorage

Arizona

Phoenix

Tucson

Arkansas

Fayetteville

Little Rock

California

Los Angeles

Oakland

Orange County

Sacramento

San Diego

San Francisco

San Jose

Colorado

Boulder

Colorado Springs

Denver

Connecticut

Hartford

DC

Washington

Florida

Fort Lauderdale

Jacksonville

Miami

Orlando

Tampa

Georgia

Atlanta

Augusta

Savannah

Hawaii

Honolulu

Idaho

Boise

Illinois

Chicago

Indiana

Indianapolis

Iowa

Cedar Rapids

Des Moines

Kansas

Wichita

Kentucky

Lexington

Louisville

Louisiana

New Orleans

Maine

Portland

Maryland

Annapolis

Baltimore

Frederick

Hagerstown

Massachusetts

Boston

Cambridge

Springfield

Michigan

Ann Arbor

Detroit

Grand Rapids

Minnesota

Minneapolis

Saint Paul

Mississippi

Jackson

Missouri

Kansas City

St. Louis

Nebraska

Lincoln

Omaha

Nevada

Las Vegas

Reno

New Jersey

Princeton

New Mexico

Albuquerque

New York

Albany

Buffalo

New York City

White Plains

North Carolina

Charlotte

Durham

Raleigh

Ohio

Akron

Canton

Cincinnati

Cleveland

Columbus

Dayton

Oklahoma

Oklahoma City

Tulsa

Oregon

Portland

Pennsylvania

Philadelphia

Pittsburgh

Rhode Island

Providence

South Carolina

Charleston

Columbia

Greenville

Tennessee

Knoxville

Memphis

Nashville

Texas

Austin

Dallas

El Paso

Houston

San Antonio

Utah

Salt Lake City

Virginia

Alexandria

Arlington

Norfolk

Richmond

Washington

Seattle

Tacoma

West Virginia

Charleston

Wisconsin

Madison

Milwaukee

Alberta

Calgary

Edmonton

British Columbia

Vancouver

Manitoba

Winnipeg

Nova Scotia

Halifax

Ontario

Ottawa

Toronto

Quebec

Montreal

Puerto Rico

San Juan