Home > Store

New KornShell Command And Programming Language, The, 2nd Edition

Register your product to gain access to bonus material or receive a coupon.

New KornShell Command And Programming Language, The, 2nd Edition

Book

  • Sorry, this book is no longer in print.
Not for Sale

About

Features

  • explains what a shell is, the benefits of the KornShell language, how to obtain ksh, and the nature of its different versions.
  • provides step-by-step tutorials on the Operating System Concepts and on the use of the KornShell language as a Command Language and as a Programming language.
  • contains a detailed manual for the emacs and vi built-in editors.
  • includes a specification for the KornShell language and a detailed guide to using it as a programming language.
  • explores application programming with the KornShell language. Provides examples of several functions and a complete sample application program written in the KornShell language.
  • provides a Quick Reference summary of the formats, options, and page references for all ksh built-in, non-built-in, and editor commands, parameters, and other details.

Description

  • Copyright 1995
  • Dimensions: 7" x 9-1/4"
  • Pages: 416
  • Edition: 2nd
  • Book
  • ISBN-10: 0-13-182700-6
  • ISBN-13: 978-0-13-182700-4

This is a Second Edition of the best-selling guide to the KornShell command and programming language by the original inventors of the language. It provides a specification for the KornShell language, tutorial material for those new to ksh (the program that implements the KornShell language), and a comprehensive reference for all ksh users. KEY TOPICS: Covers major new additions to the KornShell language ksh93 (including command completion and a key binding mechanism); provides tutorials for both of the functions of ksh (as an interactive command language, and as a programming language); contains numerous examples illustrating the features of ksh; and features a Quick Reference summary of the KornShell language with page references to the book. MARKET: For both new users with little shell experience, and for experienced computer users who are familiar with ksh and/or other shells. ISBN of 1st Edition: 0-13-516972-02.

Sample Content

Table of Contents

I. INTRODUCTION.

 1. About the KornShell Language.
 2. Notation Used in This Book.

II. TUTORIAL.

 3. Operating System Concepts.
 4. Command Language.
 5. Programming Language.
 6. Customizing Your Environment.

III. THE BUILT-IN EDITORS.

 7. Introduction.
 8. emacs Built-in Editor.
 9. vi Built-in Editor.

IV. PROGRAMMING LANGUAGE.

10. Syntax.
11. Command Processing.
12. Compound Commands.
13. Parameters.
14. Built-in Commands.
15. Other Commands.
16. Invocation and Environment.

V. APPLICATION PROGRAMMING.

17. Shell Functions and Programs.
18. A Complete Application.

VI. APPENDIX.

19. Glossary.
20. Quick Reference.
21. Portability.
22. Character Set.
Index.
Quick Index.

Preface

This second edition of the KornShell book is the specification of the revised KornShell language and a reference handbook for ksh, the program that implements the KornShell language.

The language has undergone major changes and additions since the first edition. The new features of the language have increased the scope of applications that are suitable for writing in ksh. In addition, command completion and a key binding mechanism have been added to this version of ksh.

This book also contains a Tutorial that describes both of the functions of ksh: as an interactive command language, and as a programming language. It contains numerous examples illustrating the features of ksh, and many chapters have exercises. It also contains a Quick Reference summary of the KornShell language, including page references to the book. The format of this second edition is similar to that of the first edition. This makes it easy for readers familiar with the first edition to use this book. In addition to describing the new features of the language, many reader suggestions have been incorporated.

This book is intended both for new users with little computer or shell experience, and for experienced computer users who are familiar with ksh and/or other shells. For new users, it has considerable tutorial material. For all users, it is a comprehensive reference handbook.

What is the KornShell Language? The KornShell language was designed and developed by David G. Korn at AT&T Bell Laboratories. It is an interactive command language that provides access to the UNIX system and to many other systems, on the many different computers and workstations on which it is implemented. The KornShell language is also a complete, powerful, high-level programming language for writing applications, often more easily and quickly than with other high-level languages. This makes it especially suitable for prototyping. There are two other widely used shells, the Bourne shell developed by Steven Bourne at AT&T Bell Laboratories, and the C shell developed by Bill Joy at the University of California. ksh has the best features of both, plus many new features of its own. Thus ksh can do much to enhance your productivity and the quality of your work, both in interacting with the system, and in programming. ksh programs are easier to write, and are more concise and readable than programs written in a lower level language such as C.

The new version of ksh has the functionality of other scripting languages such as awk, icon, perl, rexx, and tcl. For this and many other reasons, ksh is a much better scripting language than any of the other popular shells. The code size for ksh is larger than the Bourne shell or C shell programs. The revised version is even larger.

In spite of its increased size, ksh provides better performance. You can write programs to run faster with ksh than with either the Bourne shell or the C shell, sometimes an order of magnitude faster. ksh has evolved and matured with extensive user feedback. It has been used by many thousands of people at AT&T since 1982, and at many other companies and universities. A survey conducted at one of the largest AT&T Bell Laboratories computer centers showed that 80% of their customers, both programmers and non-programmers, use ksh. ksh is compatible with the Bourne shell. Virtually all programs written for the Bourne shell run with ksh. If you are familiar with the Bourne shell, you can use ksh immediately, without retraining. The new version of ksh is compatible with earlier versions of ksh. ksh is readily available. It is sold (source and binary) by AT&T and Novell, and by other companies under license from AT&T both in the USA and abroad. It has been purchased by dozens of major corporations, and by many individuals for use on home computers. ksh is extensible.

The KornShell language uses the same syntax for built-in commands as for non built-in commands. Therefore, system developers can add new commands "transparently" to the KornShell language; that is, with minimum effort and with no differences visible to users other than faster execution. On systems with dynamic linking, it is possible to add new built-in commands at run time. Novell has extended the new version of ksh to enable X-windows programming for their desktop ksh product, dtksh. dtksh is a standard part of CDE, the Common Desktop Environment defined by COSE (Common Operating System Environment), supported by most major UNIX system hardware vendors.

ksh is intended to conform to the Shell Language Standard developed by the IEEE POSIX 1003.2 Shell and Utilities Language Committee. At the time the manuscript of this book was sent to the publisher, 1992 was the current version of the POSIX Standard. To the best of our knowledge, the description of ksh in this book is consistent with the 1992 standard.

Organization of this Book

Part I, Introduction, tells what a shell is and lists the benefits of the KornShell language. It tells how to obtain ksh and explains about different versions of ksh. It also specifies the notation used in this book.

Part II, Tutorial, has chapters on Operating System Concepts and on the use of the KornShell language as a Command Language and a Programming Language. The Operating System Concepts chapter covers files, processes, strings and patterns that provides background information to help you understand the KornShell language. You do not have to understand everything in it to read the remaining chapters.

The Command Language chapter is intended as a guide through the language by giving step-by-step instructions for some of the typical uses of ksh. It is not intended to explain in detail all of the features of ksh, or all of the possible uses of the features that are discussed in this chapter. All of the features of the KornShell language are covered in detail elsewhere in this book.

The Programming Language chapter is intended as an introduction to the features of the KornShell that are used primarily for writing scripts or applications in the shell language.

Part II, Tutorial, also has a chapter on Customizing Your Environment, which describes how to set up your profile and environment files. It also suggests ways for optimizing the performance of shell scripts.

Part III, The Built-In Editors, is a detailed manual for the emacs and vi built-in line editors that are part of ksh. Each of these is a subset of the corresponding editor. A major benefit of using ksh is that you can use emacs or vi directives to edit your current command line, or to edit and reenter previous commands.

Part IV, Programming Language, is both a specification for the KornShell language and a detailed guide to using it. It contains chapters on Syntax, Command Processing, Compound Commands, Parameters, Built-in Commands, and Invocation and Environment. It also contains a chapter, Other Commands, which documents programs that are not part of ksh, but which are used in the examples in this book and may prove useful to many users. UNIX systems and many other systems have these programs.

Part V, Application Programming, has a chapter on Shell Functions and Programs, with several functions and programs written in the KornShell language. They are included primarily for illustrative purposes. However, you may find some of these functions and/or programs useful.

It also has the chapter, A Complete Application, with an example of how to use ksh as a high-level programming language, to program an application. The example that we use is a slightly modified version of the MH (Message Handling) system.

Part VI, Appendix, contains a Glossary. It also has a Quick Reference, with the formats, options, and page references for all ksh built-in, non-built-in, and editor commands, parameters, and other details.

The Portability chapter contains information to help you write portable scripts. There are sections listing features of ksh not in the Bourne Shell, features of ksh not in the System V Release 4 Shell, and features of ksh not in the POSIX shell. This chapter also lists ksh features that are in the POSIX shell but not in the System V Release 4 shell. In addition it discusses incompatibilities between ksh and the System V Release 4 Bourne Shell, and how ksh meets the POSIX requirements. A summary of all the new features in the 12/28/93 version of ksh, obsolescent features, and possible extensions to ksh are presented. Because of the large number of csh users migrating to ksh, we have included a section of helpful hints for making this task easier.

The Character Set chapter defines the character representation for ASCII encoding, and the character classes that each character belongs to in the C and POSIX locales.

There is also a detailed Index. The outside back cover has page references to all commands and parameters, and a brief summary of key emacs and vi directives.

Obtaining Examples in this Book in Electronic Form

The code for many of the examples in this book is available on the Internet via anonymous ftp to ftp.research.att.com. The programs are in the directory dist/ksh/examples.

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020