You are previewing Qshell for iSeries.
O'Reilly logo
Qshell for iSeries

Book Description

From the basics of programming in the Qshell on iSeries to complete coverage of previously undocumented topics, programmers will not only learn the Qshell more easily than they can with the Qshell manual from IBM, they will also learn practical applications of using the Qshell effectively. Written for users who are more comfortable with DDS, CL, and RPG as well as those using modern languages such as C and Java, this book allows those who are unfamiliar with Unix to easily learn this technology, which otherwise might be foreign to them. Although written specifically for iSeries programmers, the information gleaned here will be largely applicable to the shells for Linux and Unix, so programmers not familiar with those platforms will find those shells much easier to learn after learning Qshell.

Table of Contents

  1. Copyright
  2. Preface
  3. Introduction to Qshell
    1. Unix and Linux Shells
    2. Qshell
    3. Summary
  4. Running Qshell
    1. Qshell in an Interactive Job
    2. Qshell in Batch Jobs
    3. Redirecting Qshell Output
    4. Summary
  5. The EDTF Text Editor
    1. Starting EDTF
    2. Introducing the Stream-File Exercises
    3. Creating a New Stream File
    4. Revising a Stream File
    5. Summary
  6. Scripting
    1. Naming a Script File
    2. Running a Script File
    3. Comments
    4. The Magic Number
    5. Executable Commands
    6. Special Scripts
    7. Your First Script
    8. Summary
  7. Parameters and Variables, Defined
    1. Command-Line Arguments
    2. Retrieving Parameter Values
    3. Special Parameters
    4. Qshell Variables
    5. Predefined Variables
    6. Summary
  8. Using Parameters and Variables
    1. Variable Expansion
    2. Pattern Modifiers
    3. Substrings
    4. Substitution Expressions
    5. Finding the Length of a Value
    6. Concatenating Strings
    7. Numeric Constants
    8. Arithmetic Expressions
    9. Summary
  9. The Exit Status and Decision-Making
    1. Setting the Exit Status
    2. The True, False, and Null Utilities
    3. The If Command
    4. The Test Utility
    5. Conditional Execution
    6. Looping Structures Governed by the Exit Status
    7. Break and Continue
    8. Summary
  10. Additional Control Structures
    1. The For Loop
    2. The Select Construct
    3. The Case Construct
    4. Summary
  11. The Integrated File System
    1. Organization
    2. Paths
    3. Links
    4. Displaying the Contents of IFS Files
    5. Authority
    6. Permissions
    7. CCSIDs
    8. Summary
  12. Input and Output
    1. Standard Files
    2. Redirection
    3. The “Noclobber” Option
    4. Pipes and Pipelines
    5. Redirection Operators and Pipes
    6. Tee
    7. Overriding Redirection
    8. “Here” Documents
    9. Filters
    10. I/O Utilities
    11. File Descriptors
    12. Summary
  13. Command-Line Arguments
    1. Conventional Rules
    2. Extracting Argument Values
    3. Summary
  14. Commands
    1. Regular and Special Built-in Utilities
    2. Dual Implementations
    3. Script Interpreters
    4. External Utilities and the Magic Number
    5. Aliases
    6. Reserved Words
    7. Functions
    8. Simple and Compound Commands
    9. The CMD Parameter
    10. Processes
    11. Locating Commands
    12. Running Commands in the Background
    13. Command Substitution
    14. The Source (DOT) Utility
    15. The Xargs Utility
    16. The Exec Utility
    17. Command Interpretation
    18. The Eval Utility
    19. Summary
  15. Functions
    1. Function Syntax
    2. Displaying Function Definitions
    3. Deleting Function Definitions
    4. Parameters
    5. Variables
    6. Invoking Functions
    7. Return and the Exit Status
    8. Retrieving Output from Functions
    9. Summary
  16. Path-Name Expansion
    1. Globbing
    2. Preventing Globbing
    3. When Globbing Fails
    4. Summary
  17. Scripts—Debugging, Signals, and Traps
    1. Debugging Using Option Settings
    2. Signals
    3. The Trap Utility
    4. The Kill Utility
    5. Summary
  18. Archives and Compression
    1. Example Data
    2. Tar
    3. The Jar Utility
    4. The Pax Utility
    5. Compress and Uncompress
    6. Summary
  19. Grep
    1. Regular Expressions
    2. Options
    3. Extended Regular Expressions (Egrep)
    4. Fgrep
    5. Exit Status
    6. Summary
  20. Sed
    1. Forms of the Sed Command
    2. Sed Options
    3. Sed Commands
    4. Examples
    5. Sed Scripts
    6. Summary
  21. Writing Programs for Qshell
    1. Running Programs within Qshell
    2. Writing RPG Programs for Qshell
    3. Writing COBOL Programs for Qshell
    4. Writing C and C++ Programs for Qshell
    5. Writing Java Programs for Qshell
    6. Option Parameters
    7. Summary
  22. Accessing OS/400-Specific Objects
    1. System
    2. Liblist
    3. Sysval
    4. Datarea
    5. Dataq
    6. Db2
    7. SQL Scripts
    8. Db2 in Interactive Mode
    9. Rfile
    10. Summary
  23. Application Development Tools
    1. The ISeries Tools for Developers
    2. Qshell and ASCII Data
    3. Graphical Utilities
    4. The Ez Utility
    5. Summary
  24. The Perl Utility
    1. Running Perl
    2. Perl Syntax
    3. Perl Examples
    4. Summary
  25. Java Development Tools
    1. The Java Utility
    2. The Javac Utility
    3. The Javadoc Utility
    4. The Jar Utility
    5. Java Examples
    6. Summary
  26. C and C++ Development Tools
    1. Compiling C and C++
    2. Examples
    3. Summary
  27. Summary of Changes by Release
    1. V5R2
    2. V5R1
    3. V4R4
    4. V4R3
  28. Qshell versus DOS
    1. Case-Sensitivity
    2. Options (Switches)
    3. Separation of Tokens
    4. Comparison of Commands
  29. Qshell and CL Commands for the IFS
    1. Qshell Commands for IFS Objects
    2. CL Commands for The IFS
  30. Index