(703)246-9100 Northern Virginia

(804)285-5830 Central Virginia

(757)420-3810 Tidewater Area

(800)294-7497 Toll Free

(804)285-3722 Fax

www.ACTisIT.com

 

Develop the skills to effectively program with the Korn shell.

 

Print Outline in PDF format

 

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.

 

You can 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

Who Needs to Attend:

 

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.

 

Prerequisites:

 

Attending an Introductory UNIX course or equivalent experience

 

Lab Exercises:

  1. Redirecting I/O

  2. Pipes and Wildcards

  3. Job Control and Aliasing

  4. Using Variables

  5. Editing Text with vi (1) or vedit

  6. Searching with Patterns

  7. String Substitutions

  8. Customizing vi (1)

  9. Basic Programming

  10. Shell Variables

  11. Shell Arithmetic

  12. Editing with vi

  13. Using the at facility

  14. Scheduling

  15. Branching

  16. Loops

  17. Programming with awk(1)

Course Content:

 

INTRODUCTION 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 I

  • Login Shell, Changing The Login Shell

  • I/O redirection (< > >>), Pipes (|), Wildcards (* ?), Background Processing (&)

  • Command Line History, Aliases, Job Control

  • UNIX Processes

SCRIPT EXECUTION PRIVILEGES

  • The x in rwx
  • Using chmod(1) To Establish Privileges
  • The Impact Of $PATH On Finding Scripts

  • Altering the PATH

  • Shell Built-In Commands

BASIC PROGRAMMING TECHNIQUES

  • Problem Definition and Breakup
  • Component Solution Development
  • Program Re-Assembly
  • Testing, Testing, Testing
  • Embedding Comments In Your Code
  • #

  • #! Magic

SHELL VARIABLES

  • Variable Names
  • Assigning Values and Attributes
  • Attributes
  • Functions
  • Scoping

  • Formatting

  • Attribute type setting

  • Debugging

  • ksh -x scriptname

  • Removing User Declared Variables

  • Arrays
  • Command Substitution
  • Quoting
  • Built-in variables
  • Positional variables

STRING OPERATORS

  • Background
  • Default Values
  • Substrings (ksh93 & pdksh)
  • Trimming
  • Shell arithmetic
  • Operators
  • Modulus
  • Doing Arithmetic
  • Built-In Functions

ADVANCED EDITING WITH vi

  • vi Clones

  • Buffers

  • Marking Position

  • Macros

  • Abbreviations

  • More vi Options

PROCESSES

  • The ps(1) command
  • ps(1) Options
  • Managing Processes
  • UNIX Signals
  • The kill(1) command
  • The killall(1) command
  • top(1)and gtop(1) (Linux)
  • The nohup(1) command
  • Perl Source to signal.pl
  • Getting Rid of Pesky Processes
  • Pipes and Processes
  • Process Priority
  • The nice(1) command
  • The renice(1) command
  • Using ps(1) with Other Utilities


Unix Eduction

Learn Shell Scripting