Corder Enterprises International (C.E.I.)

    CU003 - UNIX Korn Shell Programming

    Length: 5 Days
    See Also "UNIX for Programmers"

    Description

    The Korn shell implements job control, command line editing, aliases, and new built-in commands and functions in addition to those features found in the Bourne shell. Topics include an overview of the shell and it's functions, control constructs (for, while, case, etc.), conditional branching, quoting, positional parameters, command substitution, pipelines, use of built-in shell commands, job control, command line editing, alias mechanisms, functions, sub-shells, signals, traps, shell programming efficiencies, and debugging. The course covers both ksh88 and ksh93. This course is applicable to all releases of UNIX which support the Korn shell.

    Course Objectives

    Upon completion of this course the attendee should be able to:

    • State how the shell functions as a user interface and command line interpreter
    • Modify built-in shell variables and create and use user-defined shell variables
    • Use I/O redirection, pipes, quoting, and filename expansion mechanisms
    • Create structured shell programs which accept and use positional parameters and exported variables
    • Use the shell flow control and conditional branching constructs (while, for, case, if, etc.)
    • Create shell programs which process interrupts, pass signals, invoke subshells and functions, and trap signals
    • Use shell debugging mechanisms to improve shell program efficiency and detect and correct errors
    • Develop a user interface menu system using shell programming constructs

    Course Materials

    • UNIX Korn Shell Programming Student Guide and course notes.

    Prerequisites


    UNIX for Programmers or equivalent experience using UNIX.

    Course Content

    • Introduction to Shell Programming
      • UNIX shells
      • Shell versions
      • Shell documentation
      • Establishing the user environment
      • Starting a sub-shell
      • The set and export commands
      • Creating and executing a shell program
      • Debugging shell programs
      • The dot(.) command
      • The exec command
      • Functions
      • Aliases
      • Installing a shell program

    • Shell Parameters and Variables
      • Named parameters (variables)
      • Assigning variables
      • Printing variables
      • The print command
      • Login shell variables
      • Reading input
      • The typeset command
      • Exporting variables
      • Variable arrays
      • Special shell parameters
      • conditional parameter substitution
      • Positional parameters
      • shift command
      • set and unset commands
      • Functions and positional parameters
      • Tilde substitution

    • Shell Input and Output
      • Command execution
      • Standard I/O
      • I/O redirectors
      • Advanced I/O redirection
      • Terminal control using tput

    • Conditional Testing
      • Exit status
      • Testing conditions
      • Pattern matching
      • if, else, and elif statements
      • The case statement
      • The eval command
      • The let command
      • The null command
      • The exit command
      • Return from functions

    • Looping Mechanisms
      • The for, while, and until loops
      • The ksh93 for loop
      • The select command
      • The true and false statements
      • The break and continue statements
      • Parsing command-line options

    • Signals and Traps
      • Signals
      • Traps

    • Programming Considerations
      • Shell development cycle
      • Processes and Files
      • Programming Hints

    • Case Study
    • Course Conclusion


    pdf icon gif
    Course
    Flyer