Example: dental hygienist

Learning the bash Shell, 3rd Edition - Lagout.org

1 Learning the bash Shell, 3rd EditionTable of Contents2 Prefacebash VersionsSummary of bash FeaturesIntended AudienceCode ExamplesChapter SummaryConventions Used in This HandbookWe'd Like to Hear from YouUsing Code ExamplesSafari EnabledAcknowledgments for the First EditionAcknowledgments for the Second EditionAcknowledgments for the Third Edition1. bash What Is a shell ? Scope of This History of unix The Bourne Again Features of Getting Interactive shell Commands, Arguments, and Filenames, Wildcards, and Brace Input and Standard I/O Background Background Background Jobs and Special Characters and Quoting Quotation Continuing Control Help2. Command-Line Enabling Command-Line The History emacs Editing Basic Word Line Moving Around in the History Textual Miscellaneous vi Editing Simple Control Mode Entering and Changing Deletion Moving Around in the History Character-Finding Textual Miscellaneous The fc History The readline Startup Key Bindings Using Keyboard Habits3.

Basic Shell Programming 6. 4.1. Shell Scripts and Functions 4.1.1. Functions 4.2. Shell Variables 4.2.1. Positional Parameters 4.2.2. Local Variables in Functions ... systems come face to face with is the shell. "Shell" is the UNIX term for a user interface to the system—something that lets you communicate with the computer via the keyboard ...

Tags:

  Programming, Unix, Shell, Shell programming

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Learning the bash Shell, 3rd Edition - Lagout.org

1 1 Learning the bash Shell, 3rd EditionTable of Contents2 Prefacebash VersionsSummary of bash FeaturesIntended AudienceCode ExamplesChapter SummaryConventions Used in This HandbookWe'd Like to Hear from YouUsing Code ExamplesSafari EnabledAcknowledgments for the First EditionAcknowledgments for the Second EditionAcknowledgments for the Third Edition1. bash What Is a shell ? Scope of This History of unix The Bourne Again Features of Getting Interactive shell Commands, Arguments, and Filenames, Wildcards, and Brace Input and Standard I/O Background Background Background Jobs and Special Characters and Quoting Quotation Continuing Control Help2. Command-Line Enabling Command-Line The History emacs Editing Basic Word Line Moving Around in the History Textual Miscellaneous vi Editing Simple Control Mode Entering and Changing Deletion Moving Around in the History Character-Finding Textual Miscellaneous The fc History The readline Startup Key Bindings Using Keyboard Habits3.

2 Customizing Your The .bash_profile, .bash_logout, and . shell Variables and Built-In Customization and Environment The Environment Customization Hints4. Basic shell shell Scripts and shell Positional Local Variables in Quoting with $@ and $* More on Variable String Syntax of String Patterns and Pattern Length Extended Pattern Command Advanced Examples: pushd and popd5. Flow Exit Combinations of Exit Condition Integer while and until6. Command-Line Options and Typed Command-Line Options with Typed Integer Variables and Arithmetic Arithmetic Variables and Arithmetic for Arrays7. Input/Output and Command-Line I/O File String Command-Line command, builtin, and eval8.

3 Process Process IDs and Job Job Foreground and Suspending a Control-Key Traps and Process ID Variables and Ignoring Resetting Advantages and Disadvantages Subshell Nested Process Substitution9. Debugging shell Basic Debugging Set Fake Debugging A bash Structure of the The Debugger A Sample bashdb Exercises10. bash Installing bash as the Standard POSIX Command-Line Environment Types of Global System Security Restricted A System Break-In Privileged Mode11. shell What's That Do? Variables and Starting Potential Don't Use bash12. bash for Your Obtaining Unpacking the What's in the Configuring and Building Testing Potential Installing bash as a Login Who Do I Turn to?

4 Asking Reporting BugsA. Related The Bourne The IEEE POSIX shell The Korn shell Clones and unix -like MKS AT&T UWINB. Reference Prompt String Built-In Commands and Reserved Built-In shell Test set shopt I/O emacs Mode vi Control Mode CommandsC. Loadable Built-InsD. Programmable Completion12 Learning the bash Shell, 3rd EditionCameron NewhamCopyright 2009 O'Reilly Media, 'Reilly Media, first thing users of the unix or Linux operatingsystems come face to face with is theshell. " shell " is theUNIX term for a user interface to the system somethingthat lets you communicate with the computer via thekeyboard and the display. Shells are just separateprograms that encapsulate the system, and, as such, thereare many to choose are usually set up with a "standard" shell thatnew users adopt without question.

5 However, some ofthese standard shells are rather old and lack manyfeatures of the newer shells. This is a shame, becauseshells have a large bearing on your working changing shells is as easy as changing hats, there isno reason not to change to the latest and greatest in the many shells to choose from, this book introducesthe Bourne Again shell (bashfor short), a moderngeneral-purpose shell . Other useful modern shells are theKorn shell (ksh) and the "Tenex C shell " (tcsh); both arealso the subjects of O'Reilly VersionsThis book is relevant to all versions ofbash, althougholder versions lack some of the features of the mostrecent version.[1]You can easily find out which versionyou are using by typingecho $BASH_VERSION.

6 Theearliest public version ofbashwas , and the mostrecent is (released in July 2004). If you have an olderversion, you might like to upgrade to the latest 12shows you how to go about it.[1]Throughout this book we have clearly marked withfootnotes the features that are not present in the a backward-compatible evolutionary successor tothe Bourne shell that includes most of the C shell 's majoradvantages as well as features from the Korn shell and afew new features of its own. Features appropriated fromthe C shell include: Directory manipulation, with thepushd,popd,anddirscommands. Job control, including thefgandbgcommandsand the ability to stop jobs with CTRL-Z. Brace expansion, for generating arbitrary strings.

7 Tilde expansion, a shorthand way to refer todirectories. Aliases, which allow you to define shorthandnames for commands or command lines. Commandhistory,whichletsyourecallpreviou sly entered 's major new features include:16 Command-line editing, allowing you to usevi- oremacs-style editing commands on your commandlines. Key bindings that allow you to set up customizedediting key sequences. Integratedprogrammingfeatures:thefunctio nalityofseveralexternalUNIX commands, includingtest,expr,getopt, andecho,has been integrated into the shell itself, enablingcommon programming tasks to be done morecleanly and efficiently. Control structures, especially theselectconstruct,which enables easy menu generation.

8 New options and variables that give you moreways to customize your environment. Onedimensionalarraysthatalloweasyreferen cing and manipulation of lists of data. Dynamic loading of built-ins, plus the ability towrite your own and load them into the AudienceThis book is designed to address casual unix and Linuxusers who are just above the "raw beginner" level. Youshould be familiar with the process of logging in, enteringcommands, and doing simple things with files. AlthoughChapter 1reviews concepts such as the tree-like file anddirectory scheme, you may find that it moves too quicklyif you're a complete neophyte. In that case, werecommend the O'Reilly handbook, Learning the UNIXO perating System, by Jerry Peek, Grace Todino, and you're an experienced user, you may wish to skipChapter 1altogether.

9 But if your experience is with the Cshell, you may find thatChapter 1reveals a few subtledifferences between thebashand C matter what your level of experience is, you willundoubtedly learn many things in this book that willmake you a more productivebashuser from majorfeatures down to details at the "nook-and-cranny" levelthat you may not have been aware you are interested in shell programming (writing shellscriptsandfunctionsthat automate everyday tasks orserve as system utilities), you should also find this bookuseful. However, we have deliberately avoided drawing astrong distinction between interactive shell use (entering18commandsduringaloginsession)a ndshellprogramming. We see shell programming as a natural,inevitable outgrowth of increasing experience as a , each chapter depends on those previous toit, and although the first three chapters are orientedtoward interactive use only, subsequent chapters describeinteractive,user-orientedfeature sinadditiontoprogramming book aims to show you that writing useful shellprograms doesn't require a computing degree.

10 Even if youare completely new to computing, there is no reason whyyou shouldn't be able to harness the power ofbashwithina short that end, we decided not to spend too much timeon features of exclusive interest to low-level systemsprogrammers. Concepts like file descriptors and specialfile types might only confuse the casual user, andanyway, we figure those of you who understand suchthings are smart enough to extrapolate the necessaryinformation from our cursory ExamplesThis book is full of examples of shell commands andprograms designed to be useful in your everyday life as auser, not just to illustrate the feature being explained. InChapter 4and onwards, we include various programmingproblems, which we calltasks, that illustrate particularshell programming concepts.


Related search queries