Bash beginners guide 1 Bash Guide for Beginners Machtelt Garrels Garrels BVBA at garrels dot be Version Last updated Edition CBash Guide for Beginners Table of Contents Introduction Why this guide Who should read this book New versions translations and av
Bash Guide for Beginners Machtelt Garrels Garrels BVBA at garrels dot be Version Last updated Edition CBash Guide for Beginners Table of Contents Introduction Why this guide Who should read this book New versions translations and availability Revision History Contributions Feedback Copyright information What do you need Conventions used in this document Organization of this document Chapter Bash and Bash scripts Common shell programs General shell functions Shell types Advantages of the Bourne Again SHell Bash is the GNU shell Features only found in bash Executing commands General Shell built-in commands Executing programs from a script Building blocks Shell building blocks Developing good scripts Properties of good scripts Structure Terminology A word on order and logic An example Bash script mysystem sh Example init script Summary Exercises Chapter Writing and debugging scripts Creating and running a script Writing and naming script sh Executing the script Script basics Which shell will run the script Adding comments Debugging Bash scripts Debugging on the entire script Debugging on part s of the script Summary Exercises i CBash Guide for Beginners Table of Contents Chapter The Bash environment Shell initialization ?les System-wide con ?guration ?les Individual user con ?guration ?les Changing shell con ?guration ?les Variables Types of variables Creating variables Exporting variables Reserved variables Special parameters Script recycling with variables Quoting characters Why Escape characters Single quotes Double quotes ANSI-C quoting Locales Shell expansion General Brace expansion Tilde expansion Shell parameter and variable expansion Command substitution Arithmetic expansion Process substitution Word splitting File name expansion Aliases What are aliases Creating and removing aliases More Bash options Displaying options Changing options Summary Exercises Chapter Regular expressions Regular expressions What are regular expressions Regular expression metacharacters Basic versus extended regular expressions Examples using grep What is grep Grep and regular expressions Pattern matching using Bash features Character ranges ii CBash Guide for Beginners Table of Contents Chapter Regular expressions Character classes Summary Exercises Chapter The GNU sed stream editor Introduction What is sed sed commands Interactive editing Printing lines containing a pattern Deleting lines of input containing a pattern Ranges of lines Find and replace with sed Non-interactive editing Reading sed commands from a ?le Writing output ?les Summary Exercises Chapter The GNU awk programming language Getting started with gawk What is gawk Gawk commands The print program Printing selected ?elds Formatting ?elds The print command and regular expressions Special patterns Gawk scripts Gawk variables The input ?eld separator The output separators The number of records User de ?ned variables More examples The printf program Summary Exercises Chapter Conditional statements Introduction to if General Simple applications of if More advanced if usage if then else constructs if then elif else constructs Nested if statements iii CBash Guide for Beginners Table of Contents Chapter Conditional statements Boolean operations Using the exit statement and if Using case statements Simpli ?ed conditions Initscript example Summary Exercises Chapter Writing interactive scripts Displaying user messages Interactive or not Using the echo built-in command Catching user input Using the read built-in
Documents similaires










-
48
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Attribution requise- Détails
- Publié le Nov 20, 2021
- Catégorie Creative Arts / Ar...
- Langue French
- Taille du fichier 823.3kB