Korn Shell Scripting

Course

Inhouse

Price on request

Description

  • Type

    Course

  • Methodology

    Inhouse

  • Duration

    5 Days

In addition to numerous short exercises to re-inforce understanding of specific language features, the course includes several longer workshops that illustrate the use of the more advanced features of the New Korn Shell in combination Unix tools and utilities to solve realistic problems. These workshops include: Developing a menu-driven shell. Data mining from web server log. Suitable for: The course is valuable for anyone who wishes to become a "Power Programmer" of the Korn shell. It will improve the productivity of system administrators, developers, network and database managers, in fact anyone who uses, maintains or develops Korn shell scripts regularly. Attendees should have some previous experience using scripts and Unix tools and utilities - course 640 provides a very suitable background.

Questions & Answers

Add your question

Our advisors and other users will be able to reply to you

Who would you like to address this question to?

Fill in your details to get a reply

We will only publish your name and question

Reviews

Course programme

Overview
The Korn Shell is used on many large Unix Server based Enterprise networks to automate system administration, run complex batch programs, and to automate various repetitive user tasks.
This course shows you how to develop effective, robust and reusable scripts using the full functionality of the Korn shell. This course covers the Old and the New Korn shell pointing out those features that are to be found in the New Korn shell, and those features of the old Korn shell that are considered to be obsolescent but are still widely used by shell programmers.

Key Skills
After completing this course you will be able to:
  • Increase your productivity as a Korn Shell programmer
  • Construct bespoke solutions using all the functionality of the New Korn shell
  • Write Korn shell scripts to automate administrative tasks
  • Know how to upgrade old Korn shell scripts
  • Be able to develop reusable Korn shell scripts using an object oriented programming approach

Practical Work
In addition to numerous short exercises to re-inforce understanding of specific language features, the course includes several longer workshops that illustrate the use of the more advanced features of the New Korn Shell in combination Unix tools and utilities to solve realistic problems. These workshops include:
  • Developing a menu-driven shell
  • Data mining from web server log files
  • Compiling reports on file system usage
  • A bulk mailing application
  • A classroom reservation system

Course Contents
Background
  • Differences between the old (ksh88) and the new (ksh93) Korn shells
  • Features of awk, grep, sed and Perl to be found in ksh93
  • How an interpreter works
The Interactive Korn Shell
  • Start up
  • The Environment - initialisation files (/etc/profile, .profile, the ENV file)
  • Prompts (primary, secondary, ...)
  • Search path - PATH variable
  • The Dot command
  • The Command line - exit status, multiple commands and command grouping
  • Command line history - redisplaying commands, command line editing
  • Aliases
  • Job control - foreground and background tasks
  • Korn shell metacharacters
  • Filename substitution (globing)
  • Variables - local, read only, environment variables
  • Special (built in) environment variables
  • Variable substitution
  • Positional parameters
  • Quoting
  • Command substitution
  • Functions
  • Standard I/O and redirection
  • The exec command
  • Pipes
  • Here documents
  • The time command
Korn shell programming
  • Creating Korn Shell scripts
  • Reading user input
  • Reading and writingfiles and working with file descriptors
  • Arithmetic - operators and the let command
  • Passing arguments to a script - positional parameters and command line arguments
  • The set command and positional parameters
  • Testing the exit status of a command ($?)
  • Conditional commands - if .. elif .. else
  • The test command
  • The new test command - [[ ]]
  • Testing File properties
  • The exit command
  • The case command
  • Iteration (looping) - for command, while command, until command
  • Iteration and the shift, break and continue commands
  • Looping and redirection (redirecting output of a loop to a file or a command, redirecting the output of a command into a loop)
  • Specifying the field separator by setting the value of the IFS built in variable
  • Arrays
  • Functions
  • Exporting functions
  • Modular ksh programming
  • Autoloaded functions
  • Signals - trapping, resetting, ignoring
  • Coprocesses
  • Debugging
  • Processing command line options using getopts
  • Security - priviledged scripts, restricted shells

Korn Shell Scripting

Price on request