|
(703)246-9100 Northern Virginia (804)285-5830 Central Virginia (757)420-3810 Tidewater Area (800)294-7497 Toll Free (804)285-3722 Fax |
UNIX (Linux) Shell Script
Duration: 4 days
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:
Redirecting I/O
Pipes and Wildcards
Job Control and Aliasing
Using Variables
Editing Text with vi (1) or vedit
Searching with Patterns
String Substitutions
Customizing vi (1)
Basic Programming
Shell Variables
Shell Arithmetic
Editing with vi
Using the at facility
Scheduling
Branching
Loops
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 Impact Of $PATH On Finding Scripts
Altering the PATH
BASIC PROGRAMMING TECHNIQUES
#
SHELL VARIABLES
Scoping
Formatting
Attribute type setting
Debugging
ksh -x scriptname
Removing User Declared Variables
STRING OPERATORS
ADVANCED EDITING WITH vi
vi Clones
Buffers
Marking Position
Macros
Abbreviations
PROCESSES