Muutke küpsiste eelistusi

E-raamat: bash Idioms: Write Powerful, Flexible, Readable Shell Scripts

  • Formaat: 170 pages
  • Ilmumisaeg: 16-Mar-2022
  • Kirjastus: O'Reilly Media
  • Keel: eng
  • ISBN-13: 9781492094708
Teised raamatud teemal:
  • Formaat - EPUB+DRM
  • Hind: 47,96 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: 170 pages
  • Ilmumisaeg: 16-Mar-2022
  • Kirjastus: O'Reilly Media
  • Keel: eng
  • ISBN-13: 9781492094708
Teised raamatud teemal:

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

Shell scripts are everywhere, especially those written in bash compatible syntax, and it's extremely useful to be able to understand and write them, but they can be complex and obscure. Complexity is the enemy of security, but it's also the enemy of readability and understanding. With this practical book, you'll learn how to decipher old bash code and write new code that's as clear and readable as possible. Your future you will thank you.

Authors Carl Albing and JP Vossen show you how to use the power and flexibility of the shell to your advantage. You'll learn how to read and write scripts like an expert, so that you can:

  • Write useful, flexible, and readable bash code...with style
  • Decode bash code such as ${MAKEMELC,,} and ${PATHNAME##*/}
  • Save time and ensure consistency when automating tasks
  • Amaze and impress colleagues with bash idioms
  • Discover how bash idioms can make your code clean and concise
Preface vii
1 A Big "if Idiom
1(8)
The Big "if"
1(2)
Or ELSE...
3(1)
More than One
3(1)
More than One Again
4(1)
Don't Do This
5(2)
Style and Readability: Recap
7(2)
2 Looping Lingo
9(10)
Looping Constructs
9(2)
Explicit Values
11(2)
Similar to Python
13(1)
Quotes and Spaces
14(1)
Developing and Testing for Loops
15(1)
While and until
16(1)
Style and Readability: Recap
17(2)
3 Just in CASE
19(12)
Make Your Case
19(2)
A Realistic Use Case
21(1)
Motivation
21(1)
Our Script
21(2)
Wrapper Scripts
23(5)
One More Twist
28(1)
Style and Readability: Recap
29(2)
4 Variable Vernacular
31(12)
Variable Reference
31(1)
Parameter Expansion
32(1)
Shorthand for basename
32(1)
Path or Prefix Removal
33(1)
Shorthand for dirname or Suffix Removal
34(1)
Other Modifiers
34(4)
Conditional Substitutions
38(1)
Default Values
38(1)
Comma-Separated Lists
38(1)
Modified Value
39(1)
$RANDOM
39(1)
Command Substitution
40(1)
Style and Readability: Recap
41(2)
5 Expressions and Arithmetic
43(8)
Arithmetic
44(2)
No Parentheses Needed
46(1)
Compound Commands
47(2)
Style and Readability: Recap
49(2)
6 Functional Framework
51(8)
Calling Functions
51(1)
Defining Functions
52(1)
Function Parameters
52(1)
Function Return Values
53(1)
Local Variables
54(1)
Function Special Cases
55(1)
Time for printf
55(1)
POSIX Output
56(1)
Getting or Using the Date and Time
57(1)
Printf for Reuse or Debugging
58(1)
Style and Readability: Recap
58(1)
7 List and Hash Handling
59(14)
Commonalities
60(1)
Lists
61(4)
Hashes
65(4)
A Simple Word Count Example
69(3)
Style and Readability: Recap
72(1)
8 Arguing
73(12)
Your First Argument
73(1)
Having Options
74(1)
Parsing Options
75(1)
Long Arguments
76(3)
HELP!
79(3)
Debug and Verbose
82(1)
Version
83(1)
Style and Readability: Recap
83(2)
9 Files and More
85(16)
Reading Files
85(1)
read
85(1)
mapfile
86(3)
Brute Force
89(1)
Fiddling with $IFS for Fun and Profit, to Read Files
89(3)
Pretend Files
92(1)
Drop-in Directories
93(1)
Using a Library
94(1)
Shebang!
94(2)
Unofficial bash Strict Mode
96(1)
Exit Codes
96(1)
It's a Trap!
97(1)
Here-Documents and Here-Strings
98(1)
Are We Interactive?
99(1)
Summary
100(1)
10 Beyond Idioms: Working with bash
101(22)
Prompts
102(2)
Bash Time Zone
104(1)
Getting User Input
104(1)
read
104(2)
pause
106(1)
select
107(1)
Aliases
108(1)
Functions
109(1)
Local Variables
110(1)
Readline Hacks
110(1)
Using logger from bash
111(1)
Handling JSON with jq
112(1)
Grepping the Process List
113(1)
Rotating Old Files
114(1)
Embedded Documentation
115(5)
Bash Debugging
120(2)
Bash Unit Testing
122(1)
Summary
122(1)
11 Developing Your Style Guide
123(14)
Readability
124(2)
Comments
126(1)
Names
127(1)
Functions
128(1)
Quoting
129(1)
Layout
130(1)
Syntax
131(1)
Other
132(1)
Script Template
132(1)
Other Style Guides
133(1)
Bash Linter
134(1)
Summary
135(2)
Appendix. The bash Idioms Style Guide 137(8)
Index 145