Op werkdagen voor 23:00 besteld, morgen in huis Gratis verzending vanaf €20
,

bash Idioms

Write Powerful, Flexible, Readable Shell Scripts

Paperback Engels 2022 9781492094753
Verkooppositie 3255Hoogste positie: 3255
Verwachte levertijd ongeveer 8 werkdagen

Samenvatting

Shell scripts are everywhere, especially those written in bash-compatible syntax. But these scripts 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.

Authors Carl Albing and JP Vossen show you how to use the power and flexibility of the shell to your advantage. You may know enough bash to get by, but this book will take your skills from manageable to magnificent. Whether you use Linux, Unix, Windows, or a Mac, you'll learn how to read and write scripts like an expert. Your future you will thank you.

You'll explore the clear idioms to use and obscure ones to avoid, 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
- Discover how bash idioms can make your code clean and concise

Specificaties

ISBN13:9781492094753
Taal:Engels
Bindwijze:paperback
Aantal pagina's:200
Uitgever:O'Reilly
Druk:1
Verschijningsdatum:31-3-2022
Hoofdrubriek:IT-management / ICT
ISSN:

Lezersrecensies

Wees de eerste die een lezersrecensie schrijft!

Geef uw waardering

Zeer goed Goed Voldoende Matig Slecht

Over Carl Albing

Carl Albing is currently a Distinguished Visiting Professor in the Department of Computer Science at the U.S. Naval Academy where he is teaching courses on programming languages and on High Performance Computing. Prior to this he was writing software for some of the biggest and fastest computers in the world as a software engineer for Cray, Inc. As an independent consultant, he is comfortable programming with C, Java, bash and much more. Carl is the coauthor of two books, one on Java development on Linux and his latest, the O'Reilly "bash Cookbook". A former software consultant, manager, analyst and programmer with an amazing breadth of software experience, Carl has worked with companies in the US, Canada and Europe. He has worked for large companies and small startups, in technical as well as in managerial and marketing roles. Carl's software projects, past and present, involve the design and development of distributed computing software, medical image processing applications, compilers, medical devices, web-based factory floor automation, and more. Carl's education includes a Ph.D. in Computer Science as well as a B.A. degree in Mathematics and an International MBA. He has spoken at conferences and training seminars in the US, Canada and Europe as well as local high schools and colleges. Carl enjoys speaking at user groups and seminars on Linux, C, Java, and bash topics.

Andere boeken door Carl Albing

Over J.P. Vossen

JP Vossen has been working with computers since the early 80s and has been in the IT industry since the early 90s, specializing in Information Security since the late 90s. He's been fascinated with scripting and automation since he first understood what an autoexec.bat was, and was delighted to discover the power and flexibility of bash and GNU on Linux in the mid-90s. He has previously written for Information Security Magazine and SearchSecurity.com, among others. On those few occasion when he's not in front of a computer, he is usually taking something apart, putting something together, or both.

Andere boeken door J.P. Vossen

Inhoudsopgave

Preface
Running bash
bash on Mac
bash in Containers
Revision Control
Hello World
Conventions Used in This Book
Using Code Examples
O’Reilly Online Learning
How to Contact Us
Acknowledgments
bash
Reviewers
O’Reilly
From Carl
From JP

1. A Big “if” Idiom
The Big “if”
Or ELSE…
More than One
More than One Again
Don’t Do This
Style and Readability: Recap

2. Looping Lingo
Looping Constructs
Explicit Values
Similar to Python
Quotes and Spaces
Developing and Testing for Loops
while and until
Style and Readability: Recap

3. Just in CASE
Make Your Case
A Realistic Use Case
Motivation
Our Script
Wrapper Scripts
One More Twist
Style and Readability: Recap

4. Variable Vernacular
Variable Reference
Parameter Expansion
Shorthand for basename
Path or Prefix Removal
Shorthand for dirname or Suffix Removal
Other Modifiers
Conditional Substitutions
Default Values
Comma-Separated Lists
Modified Value
$RANDOM
Command Substitution
Style and Readability: Recap

5. Expressions and Arithmetic
Arithmetic
No Parentheses Needed
Compound Commands
Style and Readability: Recap

6. Functional Framework
Calling Functions
Defining Functions
Function Parameters
Function Return Values
Local Variables
Function Special Cases
Time for printf
POSIX Output
Getting or Using the Date and Time
printf for Reuse or Debugging
Style and Readability: Recap

7. List and Hash Handling
Commonalities
Lists
Hashes
A Simple Word Count Example
Style and Readability: Recap

8. Arguing
Your First Argument
Having Options
Parsing Options
Long Arguments
HELP!
Debug and Verbose
Version
Style and Readability: Recap

9. Files and More
Reading Files
read
mapfile
Brute Force
Fiddling with $IFS for Fun and Profit, to Read Files
Pretend Files
Drop-in Directories
Using a Library
Shebang!
Unofficial bash Strict Mode
Exit Codes
It’s a Trap!
Here-Documents and Here-Strings
Are We Interactive?
Summary

10. Beyond Idioms: Working with bash
Prompts
bash Time Zone
Getting User Input
read
pause
select
Aliases
Functions
Local Variables
Readline Hacks
Using logger from bash
Handling JSON with jq
Grepping the Process List
Rotating Old Files
Embedded Documentation
bash Debugging
bash Unit Testing
Summary

11. Developing Your Style Guide
Readability
Comments
Names
Functions
Quoting
Layout
Syntax
Other
Script Template
Other Style Guides
bash Linter
Summary

A. The bash Idioms Style Guide
Readability
Comments
Names
Functions
Quoting
Layout
Syntax
Other
Script Template

Index
About the Authors

Managementboek Top 100

Rubrieken

Populaire producten

    Personen

      Trefwoorden

        bash Idioms