Skip Ribbon Commands
Skip to main content

S-321 - UNIX Shell Scripting

Price:

Duration: 4 Days

Audience:

Level:

Technology:

Delivery Method:

Software Assurance Value:

Microsoft CPE:

Course Information

Course Description

​This course is intended to help take you from having a rudimentary knowledge of UNIX shell to being able to automate some tasks under UNIX. There is no system-imposed distinction between typing commands into the shell and writing scripts. The vast majority of the constructs that are discussed in the next 4 days can be used just as easily from the command line as they can from within a script. Once you learn to use these techniques from within scripts you will find uses for them from the command line.

Attendees will learn to:
  • Understand the basic features and the differences between the various UNIX shells
  • Manipulate shell variables to configure your environment
  • Create and edit files using the vi editor, Use advanced vi features
  • Set execution privileges on scripts
  • Understand basic programming constructs
  • Create shell variables, Perform shell arithmetic
  • Understand the ps command
  • Use UNIX job scheduling to automate tasks
  • Use conditional logic within scripts
  • Execute a series of commands repetitively (loop)
  • Put together sets of commands you use in the shell into a script
  • Debug your scripts, Use the sed and the awk utility

Course Objectives

Course Audience

​Software developers, power users, system administrators or those who want to increase their productivity in using, or administering their UNIX system or who want to take advantage of Korn shell features when developing software for UNIX systems.

Course Outline

Introduction

This course is intended to help take you from having a rudimentary knowledge of UNIX shell to being able to automate some tasks under UNIX. There is no system-imposed distinction between typing commands into the shell and writing scripts. The vast majority of the constructs that are discussed in the next 4 days can be used just as easily from the command line as they can from within a script. Once you learn to use these techniques from within scripts you will find uses for them from the command line.
Attendees will learn to:
    • Understand the basic features and the differences between the various UNIX shells
    • Manipulate shell variables to configure your environment
    • Create and edit files using the vi editor, Use advanced vi features
    • Set execution privileges on scripts
    • Understand basic programming constructs
    • Create shell variables, Perform shell arithmetic
    • Understand the ps command
    • Use UNIX job scheduling to automate tasks
    • Use conditional logic within scripts
    • Execute a series of commands repetitively (loop)
    • Put together sets of commands you use in the shell into a script
    • Debug your scripts, Use the sed and the awk utility

Course Format

This course is 50 percent lecture and 50 percent lab.

Prerequisites

Before beginning this course, students should:
    • Attend course S-221 UNIX Introduction to Commands, or equivalent experience
The course materials, lectures, and lab exercises are in English. To benefit fully from our instruction, students need an understanding of the English language and completion of the prerequisites.

Return to top

INTRODUCTION TO THE UNIX SHELLINTRODUCTION TO THE UNIX SHELL

  • Shell Overview, Shell Options, Shell Features, UNIX variants and shells
  • I/O Redirection, Job Control, Background Processing
  • Wildcard Characters, Aliases
  • Command Line History

    WORKING WITH SHELL SETTINGS

  • Shell Variables, Creating variables and assigning values, Using echo(1) to display variable values, Special Shell Variables, Special Variable Commands
  • Viewing current settings, Uses of set(1)
  • Controlling Your Login
  • Ksh, bash
  • The ksh(1) ENV variable, Testing your ENV file using exec(1), The stty(1) command

    EDITING FILES WITH vi

  • Using vi(1), vi(1) modes, vi(1) commands, Norming String Substitutions in vi(1), Customizing the vi(1) Environment, ex(1) commands
  • Insert Mode, Moving around the file, Modifying text, Colon mode
  • Searching and Pattern Matching with Regular Expressions, Regular Expression Meta Characters, Defining a Character Class, Searching with a Character Class
  • The .exrc file

    THE KORN SHELL AND OTHER UNIX SHELLS

  • Features of the Shells
  • Bourne Shell (sh), Bourne Again Shell (bash), C Shell (csh), Korn Shell (ksh), ksh88 vs. ksh93, Public Domain Korn Shell (pdksh), The Restricted Shell
  • Login Shell, Changing The Login Shell
  • I/O redirection (

Course Prerequisites

​Before beginning this course, students should:

  • Attend course S-221 UNIX Introduction to Commands, or equivalent experience
The course materials, lectures, and lab exercises are in English. To benefit fully from our instruction, students need an understanding of the English language and completion of the prerequisites.
Course Schedule
This course is not scheduled yet.