Software Skills Training, Inc.
978-250-4983
Catalog Course Schedules In House Training Registration Student Feedback
Cost Effective Training Solutions



Register Now

Discount Programs

Korn Shell Programming


Price: Contact SST for pricing  |  Duration: 3 days

Prerequisites: Familiarity with UNIX file system and commands

Description: This hands on Korn Shell scripting course provides a comprehensive introduction to writing Korn shell scripts. Besides covering fundamental syntax for program flow control, variable assignment and substitution, I/O control, and mathematical expressions, it emphasizes the powerful features that are unique to this shell, including built-in string operators, variable typesetting/conversion, functions, and coprocess communication and control. The creative use of standard UNIX utilities within scripts to solve problems is stressed throughout. The course is designed for the administrators and programmers who are developing, testing, or integrating software on UNIX, as well as for advanced UNIX users.

Introduction
  • Shells: Bourne, Korn, C, bash
  • Korn Shell Environment
  • Startup Scripts (.profile, .kshrc)
  • Using ENV for automatic environment tailoring
Variables
  • Assigning Values to Variables
  • set and Special Variables
  • unset
  • Built-in Variables Known to Login Shell
  • The Environment- Exporting Variables
Input/Output
  • Basic I/O Features
  • String and Field Processing
  • Streams and pipes (exec)
  • Terminal Information (COLUMNS, LINES, TERM)
  • stty
String Manipulation
  • String Comparison
  • String Relations
  • Concatenation
  • Substring Manipulations
  • Wildcards and Pattern Matching
Math Operators and Functions
  • Dealing with Floating Point Numbers
Command Line Arguments
  • Positional Parameters
  • Manipulating Positional Parameters (set, sort, shift)
  • Analyzing Switches with getopts
  • Options Reserved Variables (OPTARG, OPTIND, IFS)
Overview of File Manipulation Utilities
  • Input/Output Redirection
  • Editing a File from a Script
  • Scripting with ed or vi
  • UNIX Utilities to Manipulate Files
  • Regular Expressions
  • grep and egrep
  • The Stream Editor sed
  • sort
  • awk
  • Other Text File Utilities 
Session Control
  • Keyboard Suspend Function
  • Foreground and Background Jobs (bg, fg, %, jobs, wait, nohup, nice)
  • Signals (kill, trap)
  • Coprocesses and Pipes
  • Error Processing (ERRNO, $?)
  • Reserved Variables
Combining Shell Scripts and Compiled Languages
  • Advantages and Disadvantages of the Korn Shell
  • Function Libraries
Using UNIX Utilities to Talk to Other Users
  • who, mail, reply, talk, lpr
Scheduling Execution
  • sleep
  • date
  • cron and crontab
UNIX Utilities to Report System Status
  • df, ps, mt, du
Korn Shell Command Syntax
  • Commands
  • Options
  • Manipulating Input and Output
    • Redirection
    • Pipes
  • Aliases (alias, unalias)
  • How the Shell Finds Commands
  • Command History and Editing
The Korn Shell as a Programming Language
  • Data Types (typeset)
    • Formatting
    • Base Conversion
    • Read Only and Other Special Attributes
  • Input/Output
  • Conditional Logic and Loops
  • Functions
  • Tests
Shell Scripts
  • Creating Scripts
  • Executing Scripts
  • Passing Arguments to Scripts
  • Built-in Variables Known to Scripts
  • Setting Variables with read
    • Printing with print
  • Special Characters
  • Exiting with exit
  • Debugging
Conditional Branching
  • If/Then
  • else/elif
  • Statement blocks
  • case Statement
  • Loops (for, while, until)
  • Simple Menus (select)
Arrays
  • Declaring Arrays
  • Setting and Retrieving Values
Manipulating Files within Scripts
  • File Operations
  • Testing Files and Directories
  • Changing Protections
Functions
  • Advantages of Functions
  • Writing Functions
  • Calling Functions
  • Functions Arguments
  • Returning Values
  • Local and Global Variables
  • Predefined Functions
  • Exporting Functions
  • Autoloading Functions
  • Returning a Value from a Function
  • Scope of Functions
  • Examples of Useful Functions
Example Uses of Scripts
  • Prototyping
  • Daily Backup
  • File Selection
  • Installation Scripts
  • Add a User
  • Change all File Extensions
  • Prompt for Input
  • Accounting