news.volyx.in

Pure Bash Bible (github.com)

746 points by ausjke · 2586 days ago · 248 comments on HN

Article summary

The Pure Bash Bible is a collection of pure bash alternatives to external processes, providing a reference for solving problems encountered when writing programs and scripts in bash. The goal is to document commonly-known and lesser-known methods of doing various tasks using only built-in bash features. Using the snippets from this bible can help remove unneeded dependencies from scripts and make them faster. The bible covers various topics such as strings, arrays, loops, and file handling.

Main themes

  • bash scripting
  • shell programming
  • alternative solutions
  • performance optimization
  • portability
  • shell limitations

What commenters say

  • Some commenters believe that bash is not suitable for complex tasks and that other languages like Python or Perl are more appropriate. Others argue that bash can be a powerful tool for simple tasks and that its limitations can be overcome with careful programming. There is a discussion about the trade-offs between using bash and other languages, with some arguing that bash is more portable and others arguing that it is less efficient. The use of bash for tasks like networking and binary data handling is also debated, with some commenters pointing out the existence of features like /dev/tcp and others highlighting the challenges of working with binary data in bash. Some commenters think that PowerShell is a viable alternative to bash, while others are skeptical about its usefulness on Linux. The idea of creating a new shell that combines the strengths of bash with the ease of use of other languages is also explored, with some commenters mentioning projects like Murex and Elvish. The importance of proper error handling and testing in shell programming is also emphasized, with some commenters recommending resources like Bash Pitfalls.