Please contact or
Mt Xia
for assistance with all your shell programming needs.
UNIX Bourne Shell Programming
I. INTRODUCTION
A. Audience
B. Course Objectives
C. Course Handout Conventions
1. BOURNESHELL OVERVIEW
1.1 What is the BourneShell?
1.2 Making a Bourne Shell Script Executable
1.3 Tracing Mechanisms
Workshop 1
2. USER, SHELL, AND READ-ONLY SHELL VARIABLES
2.1 User Variables.
2.2 Shell Variables.
2.2.1 HOME
2.2.2 IFS
2.2.3 MAIL
2.2.4 MAILPATH
2.2.5 MAILCHECK
2.2.6 PATH
2.2.7 PS1
2.2.8 PS2
2.3 Read-Only User Variables.
2.4 Read-Only Shell Variables.
2.4.1 Name of the Calling Program
2.4.2 Arguments
2.4.3 Shift
2.4.4 Set
2.4.5 expr
Workshop 2.
3. POSITIONAL PARAMETERS
3.1 Reading Input Into a Shell Variable.
3.2 Command Substitution.
3.3 Comments in BourneShell Scripts.
3.4 BourneShell Environment - Exporting Variables.
Workshop 3.
4. CONTROL CONSTRUCTS:
4.1 Types of Tests Used with Control Constructs:.
4.2 Test on Numeric Values.
4.3 Test on Character Strings.
4.4 Test on File Types.
4.5 if then.
4.6 if then else.
4.7 if then elif.
4.8 for.
4.9 while.
4.10 until.
4.11 case.
Workshop 4..
5. COMPILING PROGRAMS IN UNIX.
5.1 "C": Sample Program with a Main and Two Functions in One
5.2 "C": Compiling a Program.
5.3 "C": Renaming the Executable Module.
5.4 "C": Giving a Name to the Output File.
5.5 "C": Producing an Assembly Listing.
5.6 "C": Main and Two Functions in Three Separate Source Files
5.7 "C": Compiling but Not Producing an Executable Module
5.8 FORTRAN: Sample Program a Main and Two Subroutine.
5.9 FORTRAN: Compiling a Program.
5.10 FORTRAN: Renaming the Executable Module.
5.11 FORTRAN: Giving a Name to the Output File.
5.12 FORTRAN: Producing an Assembly Listing.
5.13 FORTRAN: Main and Two Subroutines in Three Separate Source Files
5.14 FORTRAN: Compiling But Not Producing an Executable Module
5.15 FORTRAN: Compiling Object Files to Produce an Executable Module
5.16 COBOL: Sample Program with a Main and Two Subroutines
5.17 COBOL: Compiling a Program.
5.18 COBOL: Running a Program.
Workshop 5.
6. UNIX TOOLS.
6.1 Processes.
6.2 Executing a Command.
6.3 Process Identification.
6.4 grep: A Pattern Matching Filter.
6.4.1 More on Regular Expressions
6.4.2 Closure
6.4.3 Some Nice grep Options
6.4.4 Summary of Regular Expression Characters
6.5 sed: Edit a File to Standard Output.
6.6 awk: A Pattern Matching Programming Language.
6.7 sort: Sort a File.
6.8 What Other Useful UNIX Tools are Available.
6.9 Archiver and Library Maintainer.
6.9.1 ar: Creating an Archive File with Object Modules
6.9.2 ar: Verifying the Contents of the Archive File
6.9.3 ar: Removing Duplicate Object Files
6.9.4 ar: Compiling Main and Archive Files
Workshop 6
7. VAX DCL TO UNIX SHELL SCRIPT CONVERSION.
7.1 Processes.
7.2 Pipes.
7.3 Input, Output, and Error Redirection.
7.4 Command Structure and File Naming Conventions.
7.5 File Management Commands.
7.6 Metacharacters.
7.7 Wildcards: Are They Really Wild?.
7.8 Summary.
Workshop 7.
8. ADVANCED FEATURES OF FTP.
8.1 Initializing FTP on UMAX.
8.2 Multiple File Transfers.
8.3 Auto Login Feature.
8.4 Macros.
8.5 Filename Translation.
8.6 Aborting Transfers.
8.7 More Remote Computer Commands.
Workshop 8.
9. OPTIONAL CHAPTER - KORNSHELL PROGRAMMING.
9.1 KornShell Variables.
9.2 User Defined Variables.
9.3 Values of Variables Between Child and Parent Processes
9.4 ksh: Aliases.
9.5 ksh: Command Line Editing.
9.6 ksh: Interactive Command Line Editing.
9.7 ksh: Functions.
9.8 ksh: The Select Construct.
9.9 ksh: Tracing and Conditional Execution.
Workshop 9
APPENDIX A - sh
APPENDIX B - test
APPENDIX C - expr
APPENDIX D - ftp
APPENDIX E - cc
APPENDIX F - f77
APPENDIX G - lint
APPENDIX H - cb
APPENDIX I - ar
APPENDIX J - time
APPENDIX K - ksh
INDEX