Advanced Unix (Korn) Shell Scripting
This course is designed to provide the required skills needed to utilize the new version of the Korn shell (ksh93) and its more advanced features. Students will learn to write with arrays, open and utilize file descriptors three and beyond, do timed reads, develop functions, and use co-processes and named pipes.
- Cost: Price on application
- Duration: 3 Days
- This course is not available as part of our public schedule but can be provided on a customised client specific basis.
Working knowledge of developing software applications
Working knowledge of Korn shell scripting
Working knowledge of object-oriented language is helpful
Basic experience in ksh88 or pdksh
This course is aimed at Systems Developers, Systems Administrators, Application Developers and Application Programmers
Using PuTTY
Customizing PuTTY
Fonts in PuTTY
Setting the text and background colors
Save settings for next login
Login at ETC
Changes to PuTTY on the fly
PuTTY window
Different “ksh” versions
“ksh93”
Write a script to determine your shell
Shell variables
Special shell variables
Variable assignment
The “test” function
“If-then-else” logic
“If-then-else” logic (cont)
“elif” logic
The “for” loop
The “read” command
Reading files with a “for” loop
Reading files in “while” loops
The “select” command
The “case” command
Positional parameters and the “set” command
The “IFS” variable
The “eval” command
“eval” example with the “cut” command
Determining string length
Sub-strings with “expr”
The “dot“ command
Command substitution
The Old “test” function
The “[[ ]]” syntax
The “(( ))” syntax
Using “(( ))” with “for” loops
The “? :” ternary operator
Accessing files with “exec”
The “read” command
The “print” command
The “echo” command
The “printf” command
Data types
“String” data type
“Integer” data type
“Floating point” data type
“Constant” data type
“Pointer” data type
“Associative array” data type
Declaring an “array”
Referencing “array” values
Declaring a “structure”
Declaring a pseudo structure
Declaring a compound variable structure
The command line
What “getopts” does
“getopts” usage
The “getopts” option list
Unknown Arguments on the command line.
Using “while, case, and shift” With “getopts”
Displaying functions
Declaring a function
Maintaining functions
Developing a function
“exit” and “return” commands
Variables and functions
Passing arguments to functions
Capturing Values from functions
Launching jobs from within a script
Co-processes
Multiple Co-processes
Named pipes
Signals and “traps”
Using “traps” in your scripts
Special “traps”
The “wait” command
The shell “logical and” - “&&”
The shell “logical or” - “||”
The “case” command
Here “<<“ input redirection
“<<“ syntax
“<<“ example
Turn off shell processing
Indent your text lines
Displaying functions
Declaring a function
Maintaining functions
Developing a function
“exit” and “return” commands
Variables and functions
Passing arguments to functions
Capturing values from functions
The “wait” command
The shell logical and “&&”
The shell logical or “||”