2005International Linear ColliderRequires access

Classic Shell Scripting

Arnold Robbins, Nelson H. F. Beebe

Open publisher page 16 citations

Abstract

Foreword Preface 1. Background 1.1 Unix History 1.2 Software Tools Principles 1.3 Summary 2. Getting Started 2.1 Scripting Languages Versus Compiled Languages 2.2 Why Use a Shell Script? 2.3 A Simple Script 2.4 Self-Contained Scripts: The #! First Line 2.5 Basic Shell Constructs 2.6 Accessing Shell Script Arguments 2.7 Simple Execution Tracing 2.8 Internationalization and Localization 2.9 Summary 3. Searching and Substitutions 3.1 Searching for Text 3.2 Regular Expressions 3.3 Working with Fields 3.4 Summary 4. Text Processing Tools 4.1 Sorting Text 4.2 Removing Duplicates 4.3 Reformatting Paragraphs 4.4 Counting Lines, Words, and Characters 4.5 Printing 4.6 Extracting the First and Last Lines 4.7 Summary 5. Pipelines Can Do Amazing Things 5.1 Extracting Data from Structured Text Files 5.2 Structured Data for the Web 5.3 Cheating at Word Puzzles 5.4 Word Lists 5.5 Tag Lists 5.6 Summary 6. Variables, Making Decisions, and Repeating Actions 6.1 Variables and Arithmetic 6.2 Exit Statuses 6.3 The case Statement 6.4 Looping 6.5 Functions 6.6 Summary 7. Input and Output, Files, and Command Evaluation 7.1 Standard Input, Output, and Error 7.2 Reading Lines with read 7.3 More About Redirections 7.4 The Full Story on printf 7.5 Tilde Expansion and Wildcards 7.6 Command Substitution 7.7 Quoting 7.8 Evaluation Order and eval 7.9 Built-in Commands 7.10 Summary 8. Production Scripts 8.1 Path Searching 8.2 Automating Software Builds 8.3 Summary 9. Enough awk to Be Dangerous 9.1 The awk Command Line 9.2 The awk Programming Model 9.3 Program Elements 9.4 Records and Fields 9.5 Patterns and Actions 9.6 One-Line Programs in awk 9.7 Statements 9.8 User-Defined Functions 9.9 String Functions 9.10 Numeric Functions 9.11 Summary 10. Working with Files 10.1 Listing Files 10.2 Updating Modification Times with touch 10.3 Creating and Using Temporary Files 10.4 Finding Files 10.5 Running Commands: xargs 10.6 Filesystem Space Information 10.7 Comparing Files 10.8 Summary 11. Extended Example: Merging User Databases 11.1 The Problem 11.2 The Password Files 11.3 Merging Password Files 11.4 Changing File Ownership 11.5 Other Real-World Issues 11.6 Summary 12. Spellchecking 12.1 The spell Program 12.2 The Original Unix Spellchecking Prototype 12.3 Improving ispell and aspell 12.4 A Spellchecker in awk 12.5 Summary 13. Processes 13.1 Process Creation 13.2 Process Listing 13.3 Process Control and Deletion 13.4 Process System-Call Tracing 13.5 Process Accounting 13.6 Delayed Scheduling of Processes 13.7 The /proc Filesystem 13.8 Summary 14. Shell Portability Issues and Extensions 14.1 Gotchas 14.2 The bash shopt Command 14.3 Common Extensions 14.4 Download Information 14.5 Other Extended Bourne-Style Shells 14.6 Shell Versions 14.7 Shell Initialization and Termination 14.8 Summary 15. Secure Shell Scripts: Getting Started 15.1 Tips for Secure Shell Scripts 15.2 Restricted Shell 15.3 Trojan Horses 15.4 Setuid Shell Scripts: A Bad Idea 15.5 ksh93 and Privileged Mode 15.6 Summary A. Writing Manual Pages B. Files and Filesystems C. Important Unix Commands Bibliography Glossary Index

About this research paper

What this paper is about

Foreword Preface 1. Background 1.1 Unix History 1.2 Software Tools Principles 1.3 Summary 2. Getting Started 2.1 Scripting Languages Versus Compiled Languages 2.2 Why Use a Shell Script? 2.3 A Simple Script 2.4 Self-Contained Scripts: The #! First Line 2.5 Basic Shell Constructs 2.6 Accessing Shell Script Arguments 2.7 Simple Execution Tracing 2.8 Internationalization and Localization 2.9 Summary 3. Searching and Substitutions 3.1 Searching for Text 3.2 Regular Expressions 3.3 Working with Fields 3.4 Summary 4. Text Processing Tools 4.1 Sorting Text 4.2 Removing Duplicates 4.3 Reformatting Paragraphs 4.4 Counting Lines, Words, and Characters 4.5 Printing 4.6 Extracting the First and Last Lines 4.7 Summary 5. Pipelines Can Do Amazing Things 5.1 Extracting Data from Structured Text Files 5.2 Structured Data for the Web 5.3 Cheating at Word Puzzles 5.4 Word Lists 5.5 Tag Lists 5.6 Summary 6. Variables, Making Decisions, and Repeating Actions 6.1 Variables and Arithmetic 6.2 Exit Statuses 6.3 The case Statement 6.4 Looping 6.5 Functions 6.6 Summary 7. Input and Output, Files, and Command Evaluation 7.1 Standard Input, Output, and Error 7.2 Reading Lines with read 7.3 More About Redirections 7.4 The Full Story on printf 7.5 Tilde Expansion and Wildcards 7.6 Command Substitution 7.7 Quoting 7.8 Evaluation Order and eval 7.9 Built-in Commands 7.10 Summary 8. Production Scripts 8.1 Path Searching 8.2 Automating Software Builds 8.3 Summary 9. Enough awk to Be Dangerous 9.1 The awk Command Line 9.2 The awk Programming Model 9.3 Program Elements 9.4 Records and Fields 9.5 Patterns and Actions 9.6 One-Line Programs in awk 9.7 Statements 9.8 User-Defined Functions 9.9 String Functions 9.10 Numeric Functions 9.11 Summary 10. Working with Files 10.1 Listing Files 10.2 Updating Modification Times with touch 10.3 Creating and Using Temporary Files 10.4 Finding Files 10.5 Running Commands: xargs 10.6 Filesystem Space Information 10.7 Comparing Files 10.8 Summary 11. Extended Example: Merging User Databases 11.1 The Problem 11.2 The Password Files 11.3 Merging Password Files 11.4 Changing File Ownership 11.5 Other Real-World Issues 11.6 Summary 12. Spellchecking 12.1 The spell Program 12.2 The Original Unix Spellchecking Prototype 12.3 Improving ispell and aspell 12.4 A Spellchecker in awk 12.5 Summary 13. Processes 13.1 Process Creation 13.2 Process Listing 13.3 Process Control and Deletion 13.4 Process System-Call Tracing 13.5 Process Accounting 13.6 Delayed Scheduling of Processes 13.7 The /proc Filesystem 13.8 Summary 14. Shell Portability Issues and Extensions 14.1 Gotchas 14.2 The bash shopt Command 14.3 Common Extensions 14.4 Download Information 14.5 Other Extended Bourne-Style Shells 14.6 Shell Versions 14.7 Shell Initialization and Termination 14.8 Summary 15. Secure Shell Scripts: Getting Started 15.1 Tips for Secure Shell Scripts 15.2 Restricted Shell 15.3 Trojan Horses 15.4 Setuid Shell Scripts: A Bad Idea 15.5 ksh93 and Privileged Mode 15.6 Summary A. Writing Manual Pages B. Files and Filesystems C. Important Unix Commands Bibliography Glossary Index

Why it matters

OpenAlex reports 16 citations for this work. Citation counts describe recorded attention and do not establish research quality.

Key contribution

A contribution statement is not available in the OpenAlex record.

Method / approach

Method details are not available in the OpenAlex metadata.

Main findings

Findings are not separately available in the OpenAlex metadata.

Limitations

Limitations are not available in the OpenAlex metadata.

Applications

Application details are not available in the OpenAlex metadata.

Available abstract

Foreword Preface 1. Background 1.1 Unix History 1.2 Software Tools Principles 1.3 Summary 2. Getting Started 2.1 Scripting Languages Versus Compiled Languages 2.2 Why Use a Shell Script? 2.3 A Simple Script 2.4 Self-Contained Scripts: The #! First Line 2.5 Basic Shell Constructs 2.6 Accessing Shell Script Arguments 2.7 Simple Execution Tracing 2.8 Internationalization and Localization 2.9 Summary 3. Searching and Substitutions 3.1 Searching for Text 3.2 Regular Expressions 3.3 Working with Fields 3.4 Summary 4. Text Processing Tools 4.1 Sorting Text 4.2 Removing Duplicates 4.3 Reformatting Paragraphs 4.4 Counting Lines, Words, and Characters 4.5 Printing 4.6 Extracting the First and Last Lines 4.7 Summary 5. Pipelines Can Do Amazing Things 5.1 Extracting Data from Structured Text Files 5.2 Structured Data for the Web 5.3 Cheating at Word Puzzles 5.4 Word Lists 5.5 Tag Lists 5.6 Summary 6. Variables, Making Decisions, and Repeating Actions 6.1 Variables and Arithmetic 6.2 Exit Statuses 6.3 The case Statement 6.4 Looping 6.5 Functions 6.6 Summary 7. Input and Output, Files, and Command Evaluation 7.1 Standard Input, Output, and Error 7.2 Reading Lines with read 7.3 More About Redirections 7.4 The Full Story on printf 7.5 Tilde Expansion and Wildcards 7.6 Command Substitution 7.7 Quoting 7.8 Evaluation Order and eval 7.9 Built-in Commands 7.10 Summary 8. Production Scripts 8.1 Path Searching 8.2 Automating Software Builds 8.3 Summary 9. Enough awk to Be Dangerous 9.1 The awk Command Line 9.2 The awk Programming Model 9.3 Program Elements 9.4 Records and Fields 9.5 Patterns and Actions 9.6 One-Line Programs in awk 9.7 Statements 9.8 User-Defined Functions 9.9 String Functions 9.10 Numeric Functions 9.11 Summary 10. Working with Files 10.1 Listing Files 10.2 Updating Modification Times with touch 10.3 Creating and Using Temporary Files 10.4 Finding Files 10.5 Running Commands: xargs 10.6 Filesystem Space Information 10.7 Comparing Files 10.8 Summary 11. Extended Example: Merging User Databases 11.1 The Problem 11.2 The Password Files 11.3 Merging Password Files 11.4 Changing File Ownership 11.5 Other Real-World Issues 11.6 Summary 12. Spellchecking 12.1 The spell Program 12.2 The Original Unix Spellchecking Prototype 12.3 Improving ispell and aspell 12.4 A Spellchecker in awk 12.5 Summary 13. Processes 13.1 Process Creation 13.2 Process Listing 13.3 Process Control and Deletion 13.4 Process System-Call Tracing 13.5 Process Accounting 13.6 Delayed Scheduling of Processes 13.7 The /proc Filesystem 13.8 Summary 14. Shell Portability Issues and Extensions 14.1 Gotchas 14.2 The bash shopt Command 14.3 Common Extensions 14.4 Download Information 14.5 Other Extended Bourne-Style Shells 14.6 Shell Versions 14.7 Shell Initialization and Termination 14.8 Summary 15. Secure Shell Scripts: Getting Started 15.1 Tips for Secure Shell Scripts 15.2 Restricted Shell 15.3 Trojan Horses 15.4 Setuid Shell Scripts: A Bad Idea 15.5 ksh93 and Privileged Mode 15.6 Summary A. Writing Manual Pages B. Files and Filesystems C. Important Unix Commands Bibliography Glossary Index

Key concepts: Computer science, Scripting language, Programming language, Unix, Tracing, Shell (structure), Word (group theory), Simple (philosophy)

Related papers

Back to paper searchBrowse research topicsOriginal source
Classic Shell Scripting — Research Paper | ScholarLens