SKIP THE SHIPPING
Use code NOSHIP during checkout to save 40% on eligible eBooks, now through January 5. Shop now.
Register your product to gain access to bonus material or receive a coupon.
Adobe® Digital Editions software.
This eBook requires the freeBefore downloading this DRM-encrypted PDF, be sure to:
Korn Shell Programming by Example is a straight-forward, nuts and bolts book that will become a standard in the libraries of Unix administrators everywhere because of its real-life examples, progressive style, and lack of unnecessary fluff. Based on the Korn shell, it is an essential reference for administrators on how to program their system, and it is also beneficial for those new to Unix who need to know how to automate their system. Most of all, Korn Shell Programming by Example teaches and arms readers with the ability to solve problems they might encounter.
Introduction.
Assumptions About the Reader. What This Book Will Give You. What This Book Will Not Give You. Conventions.
What Is a Shell? What Is a Shell Script? #!/bin/ksh Explained.
File Attributes. Directories. chmod.
Coming Full Circle-Back to umask. #-Comments Explained. The .profile Script. Aliases. Ksh Environment Options. Variables.
Shell Variables. Built-In Variables. Environment Variables.
Environment File. History File and Repetition.
How to Run a Script. Jobs and Processes.
Starting a Process. Stopping a Process. Background. Foreground.
Signals.
Control Key Signals. ps. kill.
nohup Explained. Scheduling Jobs.
cron. at.
Case Sensitivity. Valid Characters. Scalar.
Accessing. Assigning. typeset. Four Common Errors.
Array.
Declaring. Assigning-Two Ways. Accessing-Two Ways.
Read-Only. Unsetting.
Regular Expressions Versus Wildcards. Character Classes. Pattern Matching.
Front. Back.
Metacharacters. Back References.
Escape Character.
Asterisk with No Escapes. Asterisk with Escape. Asterisk with No Escapes from a Different Directory. Asterisk with Two Escapes.
Aggregate Quoting Options.
Single Quotes. Double Quotes.
Line Continuation. Command Substitution-Two Ways. Parameter Expansion. Arithmetic Expansion.
Arithmetic Expressions.
If Test.
Exit Status. The (( and [[ Commands. Syntax Options Used for Testing. Commands Within If Tests. One-Line If Tests Using && or ||.
Compound If Tests.
Nested If Tests.
case Conditionals. Looping Constructs.
while Loops. until Loops. for Loops. select Loops.
Loop-Related Commands. Backup Loop Example.
Functions.
Command-Line Functions Viewing Functions. Function Arguments Versus Command-Line Arguments. Function Return Values (Integer). Function Return Values (String).
Function Programming Details.
Local Variables. Global Variables. Argument Passing by Reference. Object-Oriented Discipline Functions. Recursive Functions. Using autoload on Functions. Built-In Extension Functions.
Math. Filters. Testing Files.
Testing Strings. Testing Numerals. Testing Numbers. Combining Tests.
Command-Line Arguments. User Input. Redirection. Coprocess.
Paths. Descriptors. Special Files. Links. Directories. Hidden Files. Attributes. Permissions. Acceptable Filenames. Accessing Files. Filtering.
head. tail. wc. cat. tee. sort. grep. sed. xargs. awk.
Using Temporary Files.
Echoing Output. printf. Output Redirection.
Subshell Output Redirection. Loop Output Redirection.
Multiple Output Redirection. Pipes Versus Redirection. stderr Redirection. Here Documents.
Syntax Checking. Command Interpretation Sequence. Verbose Mode. Execution Trace. Debugging Hooks.
Defining and Using Traps. Documentation Support. Self-Help Scripts. Bulletproofing.
The sys_check Script.
Command Options.h. Command Options (Invalid). Command Options.n.
First sys_check Run. Second sys_check Run. Numbered Version of sys_check Script.
Comments on Selected sys_check Lines (10-59). Comments on Selected sys_check Lines (70-102). Comments on Selected sys_check Lines (108-125). Comments on Selected sys_check Lines (130-140). Comments on Selected sys_check Lines (144-204). Comments on Selected sys_check Lines (207-220). Comments on Selected sys_check Lines (222-264). Comments on Selected sys_check Lines (275-281). Comments on Selected sys_check Lines (285-319).
alias. autoload. bg. break. builtin. case. cat. cd. chmod. command. continue. cp. cut. date. disown. echo. ed. eval. exec. exit. export. false. fc. fg. find. float. for. function. getconf. getopts. grep. hash. hist. history. if. integer. jobs. kill. [. let. ln. mv. newgrp. nohup. :. paste. print. printf. pwd. r. read. readonly. return. rm. rmdir. script. select. set. shift. sleep. sort. stop. tail. tee. test. time. touch. tr. trap. true. tty. type. typeset. ulimit. umask. unalias. uniq. unset. until. wait. wc. whence. while. who.
Where vi Came From. Starting an Edit Session. Modes of Operation.
Command Mode. Insert Mode.
Last-Line Mode. Exiting from the Editor. Moving the Cursor. Deleting. Cutting and Pasting. Using Multiple Buffers. Searching and Replacing.
Combining Buffers and Substitute Commands.
Changing vi Environment Settings. Edit Session Recovery. Miscellaneous Commands.