Enjoy fast, FREE delivery, exclusive deals and award-winning movies & TV shows with Prime
Try Prime
and start saving today with Fast, FREE Delivery
Amazon Prime includes:
Fast, FREE Delivery is available to Prime members. To join, select "Try Amazon Prime and start saving today with Fast, FREE Delivery" below the Add to Cart button.
Amazon Prime members enjoy:- Cardmembers earn 5% Back at Amazon.com with a Prime Credit Card.
- Unlimited Free Two-Day Delivery
- Instant streaming of thousands of movies and TV episodes with Prime Video
- A Kindle book to borrow for free each month - with no due dates
- Listen to over 2 million songs and hundreds of playlists
- Unlimited photo storage with anywhere access
Important: Your credit card will NOT be charged when you start your free trial or if you cancel during the trial period. If you're happy with Amazon Prime, do nothing. At the end of the free trial, your membership will automatically upgrade to a monthly membership.
Buy new:
$64.99$64.99
FREE delivery:
Thursday, June 1
Ships from: Amazon Sold by: Swisstock
Buy used: $14.47
Other Sellers on Amazon
Order now and we'll deliver when available. We'll e-mail you with an estimated delivery date as soon as we have more information. Your account will only be charged when we ship the item.
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required. Learn more
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Linux and Unix Shell Programming 1st Edition
| Price | New from | Used from |
Purchase options and add-ons
This comprehensive book is a practical, easy-to-use guide to programming and using the Bourne shell for beginners and experienced users - the Bourne shell is the standard shell for UNIX, and is also fully backward compatible to the Linux BASH shell. This book will fully illustrate the ability of the shell to unlock the real potential of UNIX and Linux, and aims to get the reader up, running and creating robust shell scripts for real tasks and situations as quickly as possible - shell scripts that will work on any mainstream UNIX or Linux machine.
If you are new to UNIX and Linux or if you are a power user in waiting then this book is for you. Most shell programming books merely annotate manual pages and syntax , but in this book users of all abilities will find plenty of practical working examples - all of which are available as full code script via an ftp site - as well as a host of tips, tricks and code one-liners, that will save you time on a day-to-day basis. The book is organized into self-contained chapters on individual topics for ease of reference.
Linux and Unix Shell Programming is structured in 5 parts:
* Part 1 deals with the Shell itself, introducing the various commands and syntax * Part 2 introduces all the major text filtering tools available to the shell * Part 3 explains the login environment and customization * Part 4 covers basic shell programming * Part 5 introduces more advanced shell programming techniques
Features: * Practical advice and guidance for beginner and advanced programmers alike * Easy access to specific topics through self-contained chapters for day-to-day reference. * Every chapter backed up with real, practical examples * Full of tested time-saving code one-liners * All programming examples and code available in electronic form
- ISBN-100201674726
- ISBN-13978-0201674729
- Edition1st
- PublisherAddison-Wesley
- Publication dateJanuary 1, 1999
- LanguageEnglish
- Dimensions7 x 1 x 9.5 inches
- Print length528 pages
Editorial Reviews
From the Inside Flap
Introduction
This book is about shell programming or to be more precise shell and Bourne
shell programming.
With LINUX now firmly taking its rightful place in the market as a viable and
robust operating system, shell programming has become even more popular. No-one
can say with any confidence how many LINUX users there are out there because
LINUX is free, though there is a growing number of third parties selling their
own LINUX variants. UNIX is still as popular as ever and growing despite a forecasted
demise by IT consultants a few years ago.
If you want to learn shell programming, then this is the book for you; even
if you are an intermediate shell user you will find the book a good learning
and reference tool as there are some handy administrative tips and one-liners
for you.
This book has been written from the outset with six main objectives in mind.
These are:
Getting the reader up to speed quickly learning about shell tools and
shell programming.
Using the book not only as a learning tool but also as a reference book.
Using shell scripts to use your system more productively.
Showing scripts that are clear and easily understandable.
Making the chapters self-contained where possible for the subject covered,
for ease of use.
Showing the reader not just shell scripting but also some administrative
tasks like rc.scripts and cgi scripts.
One of the annoying things about certain books on this topic was how some scripting
examples were made to look complicated just to save a few lines of extra code.
You won't find that sort of thing happening in this book: all the code in this
book is simple but effective.
If you're reading this, then you have probably already got your own reasons
for learning shell programming; great. If you want to know the main reasons
for learning shell programming they are:
The shell is a programming language all on its own; it has iteration,
conditions and testing constructs and it's easy to use.
You can create scripts quickly.
You can automate boring manual tasks using scripts.
The Bourne shell
The Bourne shell is the standard shell shipped with all UNIX systems and is
linked into the LINUX bash shell. A book about shell programming that covers
all leading systems must cover the Bourne shell. There are other shells, mind
you, like bash, Korn, and the C shell. If you are familiar with the bash shell,
the scripts presented in this book will run on your system, because bash is
backward-compatible with Bourne. If you have the Korn shell, the syntax of the
shell is very close.
If you look at installation scripts you will find that over 95 per cent of them
are Bourne shell scripts. This is simply because the person who wrote the script
knows it will run on any UNIX or LINUX system.
Shell portability
When you write a script that you want to run on any system it has to be what
is called portable. Portability of scripts has two major issues:
script syntax of the shell you are using;
shell commands.
The first issue is practically already solved if you are going to program with
the Bourne shell: it has few or no portability problems.
Most shell scripts spend at least 20 per cent (or probably more) of their time
using shell commands such as cp, mv, mkdir etc. This is where the problems of
portability come in. Different system vendors have different command options
on their machines; coupled with this if you have UNIX then you are either a
SystemíV or BSD user. This book uses generic scripts and command examples.
I have only used options and commands that are common to both SystemíV
and BSD and in my opinion useful, throughout the book. Where there are slight
differences they are pointed out with an alternative command, but these are
few and far between.
Organization of the book
This book is organized as both a learning tool and a reference book, therefore
do not think that you have to read each chapter in sequential order. Feel free
to wander through the chapters or even start on the last chapter, if you want
to knock up some cgi-based HTML pages.
The book is split into five parts, and within those parts are chapters dealing
with different aspects of the shell and shell programming.
The book is full of complete working examples of scripts.
The shell
In Part 1 of this book we will cover the topics that show you how to list files
using patterns, and how to change directories quickly. When you create a file,
you want to make sure it has the right permissions and directories. This is
also covered. Coverage is also given to file operations such as umask and group
file ownerships.
To avoid endlessly searching for files you have created, a whole chapter is
devoted to the find command.
When your scripts are up and running you will at some point want to run them
during the night or late in the evening: you will discover how to do this in
the chapter dealing with running commands unattended.
The nitty-gritty of any shell is its ability to read commands into a file or
from a terminal and also display the output. This is also covered. You may want
to run certain commands only if the previous command succeeded -- no problem,
that's covered as well.
Text file filtering
Part 2 of the book covers all the major test filtering tools. Text filtering
includes all you need to know about filtering text before your scripts get hold
of the information, during the script execution and the output of the text.
Topics include awk, a language by itself; grep, a text file searching utility;
and sed, an in-line editor that lets you edit on the fly. We also cover sorting,
merging and pasting files and records. There is also a chapter on tr, the character
translation utility.
Login environment
Part 3 covers your login environment and how to customize it. Understand which
files are executed when you login. Learn all about local and global variables.
Uncover the mystery surrounding quoting, so you can use variables to their full
power.
Basic shell programming
Part 4 of the book is all about shell scripting. The basics are explained including
how to make a file executable and run it in the shell; different control constructs;
and how to test for different types of conditions and take action based on that
result. Once we have covered all the angles with working scripts we then look
at functions. Functions are pieces of reusable code, and we will see how to
use and share these functions between scripts.
Being able to pass arguments to a shell script is an important function. We
look at three different methods of using commands that are passed to scripts.
By now we are putting together competent scripts, so all that we need now is
some information on using colour and control characters -- guess what, we cover
that as well. No shell programming book should be without a file updating system,
and there's a whole chapter devoted to this subject in this book. We finish
off this part of the book looking at other built-in shell commands we have not
yet covered.
Better scripting skills
Is there really a subject such as better scripting skills? You bet there is.
That's what Part 5 of the book is all about. We look at the more advanced areas
of scripting, and we cover signals and traps, so your scripts can take action
if someone tries to kill them. We also look a bit more at here documents. What
are here documents, you might say? They let you give input into your scripts
or, to put it another way, the scripts get a touch of remote control.
Have you ever wondered how some programs get started automatically when a system
boots up? It's no secret; we will look at run levels and how to put an rc.script
together. If you follow the examples in this chapter you will have your own
scripts up and running when your machine boots up.
There's a chapter containing a small collection of smallish but favourite scripts,
which includes amongst others how to deny access to other users without touching
the /etc/passwd file. If you have ever wondered how to put html pages together,
send information to another page, or continuously refresh pages, we look at
cgi-bin scripting using not Perl but Bourne shell scripts.
There are also two appendices, AppendixíA which deals with the ASCII
chart, and AppendixíB which contains some useful shell commands commands.
Assumptions
I assume the person who is reading this book knows how to login into a shell,
change directories, and how to use a text editor.
If you want to try out the cgi scripts that are covered in Part 4, you should
really have a Web server installed and be able to run cgi scripts on your machine
(though this is not a 'must have' condition).
Conventions used in this book
Throughout this book the following conventions are used:
CTRL-key
means hold the control key and the key specified. For instance CTRL-O means
hold down the control key as well as the letter O.
This typeface
means a non-command example or text of special interest.
This typeface
is used for all script listings.
This typeface
is used for any command line or script input and output.
In the first two parts of the book, you will find text boxes that look like
this:
If it's LINUX thenÄ.Ä.Ä. These have been used to quickly point
out differences between the BSD/LINUX and SystemíV command that is currently
being described.
I have tested the scripts both on LINUX (Redhat) and on AIX, and some scripts
have also been tested on Data Generals.
I hope you enjoy the book, not only as a learning tool but also as a reference
tool. Enjoy and have fun. Stand-by to stand-to.
Any comments, or just to say hello, e-mail me at dtansley@my-Deja.
0201674726P04062001
From the Back Cover
With more and more systems being run under UNIX and Linux, the ability to program and customize the shell quickly and reliably to get the best out of any individual system is becoming a more and more important skill for anyone operating and maintaining these systems.
This comprehensive book is a practical, easy-to-use guide to programming and using the Bourne shell for beginners and experienced users - the Bourne shell is the standard shell for UNIX, and is also fully backward compatible to the Linux BASH shell. This book will fully illustrate the ability of the shell to unlock the real potential of UNIX and Linux, and aims to get the reader up, running and creating robust shell scripts for real tasks and situations as quickly as possible shell scripts that will work on any mainstream UNIX or Linux machine.
If you are new to UNIX and Linux or if you are a power user in waiting then this book is for you. Most shell programming books merely annotate manual pages and syntax , but in this book users of all abilities will find plenty of practical working examples - all of which are available as full code script via an ftp site as well as a host of tips, tricks and code one-liners, that will save you time on a day-to-day basis. The book is organized into self-contained chapters on individual topics for ease of reference.
Linux and Unix Shell Programming is structured in 5 parts: Part 1 deals with the Shell itself, introducing the various commands and syntax Part 2 introduces all the major text filtering tools available to the shell Part 3 explains the login environment and customization Part 4 covers basic shell programming Part 5 introduces more advanced shell programming techniques
Features:
Practical advice and guidance for beginner and advanced programmers alike Easy access to specific topics through self-contained chapters for day-to-day reference. Every chapter backed up with real, practical examples Full of tested time-saving code one-liners All programming examples and code available in electronic form
0201674726B07092001
About the Author
Linux, as a systems administrator on a variety of platforms, and is currently
a Systems and Database Administrator at Ace Global Markets, a Lloyds of London
Underwriting Agency.
0201674726AB04062001
Excerpt. © Reprinted by permission. All rights reserved.
Introduction
This book is about shell programming or to be more precise shell and Bourne shell programming.
With LINUX now firmly taking its rightful place in the market as a viable and robust operating system, shell programming has become even more popular. No-one can say with any confidence how many LINUX users there are out there because LINUX is free, though there is a growing number of third parties selling their own LINUX variants. UNIX is still as popular as ever and growing despite a forecasted demise by IT consultants a few years ago.
If you want to learn shell programming, then this is the book for you; even if you are an intermediate shell user you will find the book a good learning and reference tool as there are some handy administrative tips and one-liners for you.
This book has been written from the outset with six main objectives in mind. These are:
Getting the reader up to speed quickly learning about shell tools and shell programming.
Using the book not only as a learning tool but also as a reference book.
Using shell scripts to use your system more productively.
Showing scripts that are clear and easily understandable.
Making the chapters self-contained where possible for the subject covered, for ease of use.
Showing the reader not just shell scripting but also some administrative tasks like rc.scripts and cgi scripts.
One of the annoying things about certain books on this topic was how some scripting examples were made to look complicated just to save a few lines of extra code. You won't find that sort of thing happening in this book: all the code in this book is simple but effective.
If you're reading this, then you have probably already got your own reasons for learning shell programming; great. If you want to know the main reasons for learning shell programming they are:
The shell is a programming language all on its own; it has iteration, conditions and testing constructs and it's easy to use.
You can create scripts quickly.
You can automate boring manual tasks using scripts.
The Bourne shell
The Bourne shell is the standard shell shipped with all UNIX systems and is linked into the LINUX bash shell. A book about shell programming that covers all leading systems must cover the Bourne shell. There are other shells, mind you, like bash, Korn, and the C shell. If you are familiar with the bash shell, the scripts presented in this book will run on your system, because bash is backward-compatible with Bourne. If you have the Korn shell, the syntax of the shell is very close.
If you look at installation scripts you will find that over 95 per cent of them are Bourne shell scripts. This is simply because the person who wrote the script knows it will run on any UNIX or LINUX system.
Shell portability
When you write a script that you want to run on any system it has to be what is called portable. Portability of scripts has two major issues:
script syntax of the shell you are using;
shell commands.
The first issue is practically already solved if you are going to program with the Bourne shell: it has few or no portability problems.
Most shell scripts spend at least 20 per cent (or probably more) of their time using shell commands such as cp, mv, mkdir etc. This is where the problems of portability come in. Different system vendors have different command options on their machines; coupled with this if you have UNIX then you are either a SystemíV or BSD user. This book uses generic scripts and command examples. I have only used options and commands that are common to both SystemíV and BSD and in my opinion useful, throughout the book. Where there are slight differences they are pointed out with an alternative command, but these are few and far between.
Organization of the book
This book is organized as both a learning tool and a reference book, therefore do not think that you have to read each chapter in sequential order. Feel free to wander through the chapters or even start on the last chapter, if you want to knock up some cgi-based HTML pages.
The book is split into five parts, and within those parts are chapters dealing with different aspects of the shell and shell programming.
The book is full of complete working examples of scripts.
The shell
In Part 1 of this book we will cover the topics that show you how to list files using patterns, and how to change directories quickly. When you create a file, you want to make sure it has the right permissions and directories. This is also covered. Coverage is also given to file operations such as umask and group file ownerships.
To avoid endlessly searching for files you have created, a whole chapter is devoted to the find command.
When your scripts are up and running you will at some point want to run them during the night or late in the evening: you will discover how to do this in the chapter dealing with running commands unattended.
The nitty-gritty of any shell is its ability to read commands into a file or from a terminal and also display the output. This is also covered. You may want to run certain commands only if the previous command succeeded -- no problem, that's covered as well.
Text file filtering
Part 2 of the book covers all the major test filtering tools. Text filtering includes all you need to know about filtering text before your scripts get hold of the information, during the script execution and the output of the text.
Topics include awk, a language by itself; grep, a text file searching utility; and sed, an in-line editor that lets you edit on the fly. We also cover sorting, merging and pasting files and records. There is also a chapter on tr, the character translation utility.
Login environment
Part 3 covers your login environment and how to customize it. Understand which files are executed when you login. Learn all about local and global variables. Uncover the mystery surrounding quoting, so you can use variables to their full power.
Basic shell programming
Part 4 of the book is all about shell scripting. The basics are explained including how to make a file executable and run it in the shell; different control constructs; and how to test for different types of conditions and take action based on that result. Once we have covered all the angles with working scripts we then look at functions. Functions are pieces of reusable code, and we will see how to use and share these functions between scripts.
Being able to pass arguments to a shell script is an important function. We look at three different methods of using commands that are passed to scripts.
By now we are putting together competent scripts, so all that we need now is some information on using colour and control characters -- guess what, we cover that as well. No shell programming book should be without a file updating system, and there's a whole chapter devoted to this subject in this book. We finish off this part of the book looking at other built-in shell commands we have not yet covered.
Better scripting skills
Is there really a subject such as better scripting skills? You bet there is. That's what Part 5 of the book is all about. We look at the more advanced areas of scripting, and we cover signals and traps, so your scripts can take action if someone tries to kill them. We also look a bit more at here documents. What are here documents, you might say? They let you give input into your scripts or, to put it another way, the scripts get a touch of remote control.
Have you ever wondered how some programs get started automatically when a system boots up? It's no secret; we will look at run levels and how to put an rc.script together. If you follow the examples in this chapter you will have your own scripts up and running when your machine boots up.
There's a chapter containing a small collection of smallish but favourite scripts, which includes amongst others how to deny access to other users without touching the /etc/passwd file. If you have ever wondered how to put html pages together, send information to another page, or continuously refresh pages, we look at cgi-bin scripting using not Perl but Bourne shell scripts.
There are also two appendices, AppendixíA which deals with the ASCII chart, and AppendixíB which contains some useful shell commands commands.
Assumptions
I assume the person who is reading this book knows how to login into a shell, change directories, and how to use a text editor.
If you want to try out the cgi scripts that are covered in Part 4, you should really have a Web server installed and be able to run cgi scripts on your machine (though this is not a 'must have' condition).
Conventions used in this book
Throughout this book the following conventions are used:
CTRL-key
means hold the control key and the key specified. For instance CTRL-O means hold down the control key as well as the letter O.
This typeface
means a non-command example or text of special interest.
This typeface
is used for all script listings.
This typeface
is used for any command line or script input and output.
In the first two parts of the book, you will find text boxes that look like this:
If it's LINUX thenÄ.Ä.Ä. These have been used to quickly point out differences between the BSD/LINUX and SystemíV command that is currently being described.
I have tested the scripts both on LINUX (Redhat) and on AIX, and some scripts have also been tested on Data Generals.
I hope you enjoy the book, not only as a learning tool but also as a reference tool. Enjoy and have fun. Stand-by to stand-to.
Any comments, or just to say hello, e-mail me at dtansley@my-Deja.com.
0201674726P04062001
Product details
- Publisher : Addison-Wesley; 1st edition (January 1, 1999)
- Language : English
- Paperback : 528 pages
- ISBN-10 : 0201674726
- ISBN-13 : 978-0201674729
- Item Weight : 1.92 pounds
- Dimensions : 7 x 1 x 9.5 inches
- Best Sellers Rank: #4,254,853 in Books (See Top 100 in Books)
- #68 in Unix Programming
- #115 in Unix Shell
- #355 in Linux Programming
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read author blogs and more
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on Amazon-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
Don't buy it if you don't have to. There's probably better books out there on this subject.
In my case, I had to add Linux to my Windows 98 computer so that I could better talk to and understand programmers who enter the programming contest at <[...] This book would almost be my "Best Friend" if such a thing were possible, because it lets me look up the DOS terms I memorized years ago and see the equivalent Linux terms and syntax. (I'm in love with that feature, by the way).
"Linux & Unix Shell Programming" even has material that will help you learn the same CGI that is found on many web pages, and, thank goodness, the wild cards I fell in love with in DOS are there.
As you can see from the table of contents, below, it covers quite alot of ground, from "Introduction to Linux/Unix in general" to "Building CGI scripts for a web site."
Cool, eh?
Definitely buy it if you're looking to understand Linux, and especially if you're an old DOS user from the early computer age.
The Table of Contents is below. I hope you fall in love with it.
John Knoderer
mazes@msoworld.com
webmaster@mazes.com
-- PART 1: THE SHELL
-- Chap 1. File Security and Permissions
-- Chap 2. Using 'find' and 'xargs'
-- Chap 3. Running Commands Unattended
-- Chap 4. Filename Substitution <-- talks about wildcards
-- Chap 5. Shell Input and Output <-- cat, echo, redirection,...
-- Chap 6. Command Execution Order
-- PART 2: TEXT FILTERING
-- Chap 7. Introducing Regular Expressions <-- Important!
-- Chap 8. The 'grep' Family
-- Chap 9. Introducing 'awk'
-- Chap 10. Using 'sed'
-- Chap 11. Merge and Divide <-- sort, uniq, cut, paste
-- Chap 12. Using 'tr'
-- PART 3: THE LOGIN ENVIRONMENT
-- Chap 13. The Login Environment
-- Chap 14. Environment and Shell Variables
-- Chap 15. Quoting
-- PART 4: BASIC SHELL PROGRAMMING
-- Chap 16. Introduction to Shell Scripts
-- Chap 17. Conditional Testing
-- Chap 18. Control Flow Structures <-- if/then/else, for, while
-- Chap 19. Shell Functions
-- Chap 20. Passing Parameters To Scripts
-- Chap 21. Creating Screen Output
-- Chap 22. Creating Screen Input
-- Chap 23. Debugging Scripts
-- Chap 24. Shell Built-in Commands
-- PART 5: BETTER SCRIPTING SKILLS
-- Chap 25. Going Further With Here Documents
-- Chap 26. Shell Utilities
-- Chap 27. A Small Collection of Scripts
-- Chap 28. Run Level Scripts
-- Chap 29. CGI Scripts <-- Yes, the CGI scripts
-- APPENDICES
-- Appendix A. ASCII Art
-- Appendix B. Useful Shell Commands
The examples are poorly presented for readability. One does not know where the target ends and the source begins because there are no spaces.
Once I have had a chance to look at the content I may revise my review upwards but so far I am unimpressed.
