Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
6Activity

Table Of Contents

What Is a Shell?
Why Use Shells?
What Kind of Shells Are There?
The Bourne Shell
The C Shell
The Korn Shell
Bash,the Bourne Again Shell
tcsh,the T C Shell
Other Shells
Graphical Shells
The Official POSIX Shell
Default Shells
Choosing a Shell
Changing Your Default Shell
Running a Shell from Within Another Shell
Finding Out More About the Shell
How Do Shells Fit into a Graphical Environment?
Running Shells on Linux
Running Shells on Mac OS X
Running Shells on Unix Systems
Running Shells on Windows—Isn’t command.com Enough?
Running Shells on PDAs and Other Systems
Entering Commands
Determining Which Shell You Are Running
Command-Line Options
Command Editing
Command Substitution
Viewing the Command History
Calling Up an Editor
Using File-Name Completion
Working with Wildcards
The * Wildcard
The ? Wildcard
Running Commands in the Background
Summary
Using Legacy Editors
Moving to Graphical Text Editors
Writing Scripts
Remembering Commands So You Don’t Have To
Outputting Text
Variables
Gathering Input
Commenting Your Scripts
Continuing Lines
Exercises
Referencing Variables
Looping and Iteration
Looping over Files
Looping for a Fixed Number of Iterations
Looping Like a C Program—the bash Shell
Looping in the C Shell
Nested Loops
Checking Conditions with if
Or Else,What?
What Is Truth?
Redirecting Output
Using elif (Short for else if)
Nesting if Statements
Testing with the test Command
Comparing Numbers
Comparing Text Strings
Testing Files
Using the Binary and Not Operators
Creating Shorthand Tests with [
Making Complex Decisions with case
Handling Problematic Input
Using case with the C Shell
Looping While a Condition Is True
Looping Until a Condition Is True
Examining Environment Variables
Reading Environment Variables
Setting Environment Variables
How the Bourne Shell Starts Up
How the Korn Shell Starts Up
How the C Shell Starts Up
How the T C Shell Starts Up
How Bash Starts Up
Handling Command-Line Arguments
Reading Command-Line Arguments with the Bourne Shell
Reading Command-Line Arguments with the C Shell
Making Scripts Executable
Marking Files Executable
Setting the #! Magic Line
Combining Files into Archives
Working with File Modes
Testing Files with the test Command
Dealing with Mac OS X Files
The Legacies of NeXT
Mobile File Systems and Mac OS X
Naming Issues
HFS+ Versus UFS: The Mac OS X Holy War
The Terror of the Resource Fork
Working with Here Files and Interactive Programs
Displaying Messages with Here Files
Customizing Here Files
Driving Interactive Programs with Here Files
Turning Off Variable Substitution
The -n,--quiet,and --silent Flags
sed Errors
Selecting Lines to Operate On
Address Ranges
Address Negation
Address Steps
Substitution
Substitution Flags
Using an Alternative String Separator
Address Substitution
Advanced sed Invocation
The comment Command
The insert,append,and change Commands
Advanced Addressing
Regular Expression Addresses
Character Class Keywords
Regular Expression Address Ranges
Combining Line Addresses with regexps
Advanced Substitution
Referencing Matched regexps with &
Back References
Hold Space
More sed Resources
Common One-Line sed Scripts
Common sed Commands
Less Common sed Commands
GNU sed-Specific sed Extensions
What Is awk (Gawk/Mawk/Nawk/Oawk)?
Gawk,the GNU awk
What Version Do I Have Installed?
Installing gawk
How awk Works
Invoking awk
The print Command
Using Field Separators
Using the printf Command
Using printf Format Modifiers
Using the sprintf Command
Using Variables in awk
User-Defined Variables
Built-in Variables
Control Statements
if Statements
Comparison Operators
Arithmetic Functions
Output Redirection
While Loops
For Loops
Functions
Resources
Working with Standard Input and Output
Redirecting Standard Input and Output
Redirecting Standard Error
Redirecting Both Standard Output and Standard Error
Appending to Files
Truncating Files
Sending Output to Nowhere Fast
Piping Commands
Piping with Unix Commands
Creating Pipelines
Using tee to Send the Output to More Than One Process
Exploring Processes
Checking Process IDs
Reading the /proc File System
Killing Processes
Launching Processes
❑Running commands in the foreground
❑Running commands in the background
Running Commands in the Foreground
Running Commands in Subshells
Running Commands with the exec Command
Capturing the Output of Processes
Using Backticks for Command Substitution
Capturing Program Return Codes
Defining Functions
Adding Names to Blocks of Code
Function Declaration Errors
Using Functions
Declaring before Use
Function Files
Common Usage Errors
Undeclaring Functions
Using Arguments with Functions
Using Return Codes with Functions
Variable Scope: Think Globally,Act Locally
Finding Syntax Errors
Tracking Down Problems with Debugging Techniques
Look Backward
Look for Obvious Mistakes
Look for Weird Things
Look for Hidden Assumptions
Divide and Conquer
Break the Script into Pieces
Trace the Execution
Get Another Set of Eyes
Running Scripts in Debugging Mode
Disabling the Shell
Displaying the Script Commands
Combining the -n and -v Options
Tracing Script Execution
Avoiding Errors with Good Scripting
Tidy Up Your Scripts
Comment Your Scripts
Create Informative Error Messages
Simplify Yourself Out of the Box
Test,Test,and Test Again
Working with MRTG
Monitoring Other Data with MRTG
Installing MRTG
Writing Scripts for MRTG
Configuring MRTG
Configuring the Global Values
Configuring MRTG Targets for Your Scripts
Customizing MRTG Output
Running MRTG
Viewing Your First MRTG Output
Configuring cron
Maximizing MRTG Performance
Monitoring Your Computer with MRTG
Graphing Memory Usage
Graphing CPU Usage
Graphing Disk Usage
Monitoring Networks with MRTG
Monitoring Applications with MRTG
Why Write Scripts?
Scripting Complicated Commands
Troubleshooting Your Systems
Removing Minor Annoyances
Cleaning Up Data
Automating Daily Work
Scripting Office Applications
Scripting the OpenOffice.org Suite
Scripting AbiWord
Scripting NEdit
Scripting for the Desktop on Mac OS X
Open Scripting Architecture
AppleScript Basics
Mac OS X Terminal Window Settings
Scripting Multimedia
Scripting the XMMS Music Player
Scripting Rhythmbox
Scripting the Totem Movie Player
Scripting Other Desktop Applications
Where to Go from Here
Index
0 of .
Results for:
No results containing your search query
P. 1
Beginning Shell Scripting PDF

Beginning Shell Scripting PDF

Ratings: (0)|Views: 29|Likes:
Published by David

More info:

Published by: David on Nov 30, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

12/01/2012

pdf

text

original

You're Reading a Free Preview
Pages 11 to 58 are not shown in this preview.
You're Reading a Free Preview
Pages 69 to 208 are not shown in this preview.
You're Reading a Free Preview
Pages 219 to 331 are not shown in this preview.
You're Reading a Free Preview
Pages 342 to 502 are not shown in this preview.
You're Reading a Free Preview
Pages 513 to 530 are not shown in this preview.

Activity (6)

You've already reviewed this. Edit your review.
1 hundred reads
DirkVoss liked this
pudge6012 liked this
Miguel Ferreira liked this
bhn2you liked this
myehia1976 liked this