↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

Pure Bash Bible

A reference of built-in Bash techniques that replace external processes and programs. The book says Bash can handle many common tasks without external dependencies, which can make scripts faster and easier to understand.

Reading notes
#

  • Collects pure Bash alternatives to external commands and programs.
  • Says external processes are expensive in Bash and can slow scripts down.
  • Presents snippets as function examples for use in scripts.
  • Notes that snippets are linted with shellcheck and tests are written where applicable.
  • Invites contributions through the repository’s contributing guide.
  • Covers strings, arrays, loops, file handling, file paths, variables, escape sequences, parameter expansion, brace expansion, conditionals, arithmetic operators, traps, performance, obsolete syntax, internal variables, terminal information, conversion, code golf, and other utilities.
  • Includes examples for trimming strings, splitting text, changing case, handling files, counting lines, working with paths, using traps, reading terminal size, converting colors, and checking whether a program is in PATH.
  • Recommends using built-ins like printf, parameter expansion, globbing, and traps instead of external tools when possible.
  • Advises using #!/usr/bin/env bash, $() command substitution, and function declarations without the function keyword for compatibility.
  • Notes that Unicode can be disabled for a performance increase in some cases.
  • Ends by encouraging readers to donate or share the repository if it helped.