Cover image for Sams teach yourself shell programming in 24 hours
Title:
Sams teach yourself shell programming in 24 hours
Author:
Veeraraghavan, Sriranga.
Personal Author:
Edition:
Second edition.
Publication Information:
Indianapolis, Ind. : Sams, [2002]

©2002
Physical Description:
xiii, 486 pages : illustrations ; 24 cm
General Note:
Includes index.
Language:
English
ISBN:
9780672323584
Format :
Book

Available:*

Library
Call Number
Material Type
Home Location
Status
Item Holds
Searching...
QA76.76.O63 S343 2002 Adult Non-Fiction Central Closed Stacks
Searching...

On Order

Summary

Summary

The vast majority of users utilize the Korn Shell or some variant of the Bourne Shell, such as bash. Sams Teach Yourself Shell Programming in 24 Hours covers these shells. It begins with a generalized tutorial of Unix and tools and then moves into detailed coverage of shell programming. Sams Teach Yourself Shell Programming in 24 Hours is one of the best values because it provides readers with more information for less money. This book uses the effective and proven 'Teach Yourself' format to instruct the reader how to make their shell work for them. It covers useful information including: managing input/output, manipulating text filters, understanding and debugging shell scripts, creating and utilizing variables, tools, processes, and customizing the shell.

Sams Teach Yourself Shell Programming in 24 Hours is a tutorial aimed at assisting Unix and Linux users to get optimal performance out of their operating system. It shows them how to take control of their systems and work efficiently by har4nessing the power of the shell to solve common problems.


Author Notes

Sriranga Veeraraghavan, a graduate of the University of California at Berkeley, is a material scientist by training and a software engineer by trade. He is currently a member of the technical staff at Sun Microsystems where he works in the Server Appliance group


Table of Contents

Introductionp. 1
Part I Introduction to UNIX and Shell Toolsp. 7
Hour 1 Shell Basicsp. 9
What Is a Command?p. 10
What Is the Shell?p. 13
Summaryp. 18
Questionsp. 19
Termsp. 19
Hour 2 Script Basicsp. 21
The UNIX Systemp. 22
Shell Modes and Initializationp. 24
Getting Helpp. 31
Summaryp. 35
Questionsp. 35
Termsp. 35
Hour 3 Working with Filesp. 37
Listing Filesp. 38
File Contentsp. 41
Manipulating Filesp. 46
Summaryp. 50
Questionsp. 51
Termsp. 51
Hour 4 Working with Directoriesp. 53
The Directory Treep. 54
Switching Directoriesp. 57
Listing Files and Directoriesp. 60
Manipulating Directoriesp. 62
Summaryp. 68
Questionsp. 68
Termsp. 69
Hour 5 Input and Outputp. 71
Outputp. 71
Inputp. 79
File Descriptorsp. 82
Summaryp. 87
Questionsp. 87
Termsp. 87
Hour 6 Manipulating File Attributesp. 89
File Typesp. 89
Owners, Groups, and Permissionsp. 95
Summaryp. 103
Questionsp. 103
Termsp. 104
Hour 7 Processesp. 105
Starting a Processp. 105
Listing and Terminating Processesp. 111
Parent and Child Processesp. 114
Summaryp. 117
Questionsp. 117
Termsp. 117
Part II Shell Programmingp. 119
Hour 8 Variablesp. 121
Working with Variablesp. 121
Environment and Shell Variablesp. 129
Summaryp. 132
Questionsp. 132
Termsp. 133
Hour 9 Substitutionp. 135
Filename Substitution (Globbing)p. 136
Variable Substitutionp. 141
Command and Arithmetic Substitutionp. 143
Summaryp. 146
Questionsp. 146
Termsp. 146
Hour 10 Quotingp. 147
Quoting with Backslashesp. 148
Using Single Quotesp. 149
Using Double Quotesp. 150
Quoting Rules and Situationsp. 151
Summaryp. 157
Questionsp. 158
Termsp. 158
Hour 11 Flow Controlp. 159
The if Statementp. 160
The case Statementp. 175
Summaryp. 178
Questionsp. 178
Termsp. 179
Hour 12 Loopsp. 181
The while Loopp. 181
The for and select Loopsp. 188
Loop Controlp. 192
Summaryp. 195
Questionsp. 195
Termsp. 196
Hour 13 Parametersp. 197
Special Variablesp. 198
Options and Argumentsp. 200
Option Parsing in Shell Scriptsp. 205
Summaryp. 210
Questionsp. 210
Termsp. 211
Hour 14 Functionsp. 213
Using Functionsp. 213
Understanding Scope, Recursion, Return Codes, and Data Sharingp. 218
Summaryp. 228
Questionsp. 228
Termsp. 229
Hour 15 Text Filtersp. 231
The head and tail Commandsp. 231
Using grepp. 234
Counting Wordsp. 238
Summaryp. 245
Questionsp. 246
Termsp. 247
Hour 16 Filtering Text with Regular Expressionsp. 249
The Basics of awk and sedp. 250
Using sedp. 257
Summaryp. 264
Questionsp. 264
Termsp. 265
Hour 17 Filtering Text with awkp. 267
What Is awk?p. 267
Using awk Featuresp. 275
Summaryp. 288
Questionsp. 289
Termsp. 291
Hour 18 Other Toolsp. 293
The Built-In Commandsp. 293
The sleep Commandp. 297
The find Commandp. 298
xargsp. 304
The expr Commandp. 306
The bc Commandp. 307
Summaryp. 308
Questionsp. 309
Termsp. 309
Part III Advanced Topicsp. 311
Hour 19 Signalsp. 313
How Are Signals Represented?p. 314
Dealing with Signalsp. 316
Summaryp. 324
Questionsp. 324
Termsp. 324
Hour 20 Debuggingp. 325
Enabling Debuggingp. 326
Using Syntax Checkingp. 328
Shell Tracingp. 332
Summaryp. 339
Questionsp. 339
Termsp. 340
Hour 21 Problem Solving with Functionsp. 341
Library Basicsp. 341
Creating a Libraryp. 343
Summaryp. 356
Questionsp. 356
Termsp. 357
Hour 22 Problem Solving with Shell Scriptsp. 359
Startup Scriptsp. 360
Maintaining an Address Bookp. 373
Summaryp. 385
Questionsp. 385
Termsp. 387
Hour 23 Scripting for Portabilityp. 389
Determining UNIX Versionsp. 390
Techniques for Increasing Portabilityp. 396
Summaryp. 400
Questionp. 401
Termsp. 401
Hour 24 Shell Programming FAQsp. 403
Shell and Command Questionsp. 404
Variable and Argument Questionsp. 409
File and Directory Questionsp. 412
Summaryp. 416
Part IV Appendixesp. 417
Appendix A Command Quick Referencep. 419
Reserved Words and Built-in
Conditional Expressionsp. 423
Arithmetic Expressions (ksh, bash, and zsh Only)p. 424
Parameters and Variablesp. 426
Input/Outputp. 428
Pattern Matching and Regular Expressionsp. 430
Appendix B Glossaryp. 433
Appendix C Answers to Questionsp. 441
Appendix D Shell Function Libraryp. 461
Indexp. 465