“Exit Traps” Can Make Your Bash Scripts Way More Robust and Reliable

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • Batsh

    A language that compiles to Bash and Windows Batch

    I wish there was a nicer shell scripting language that simply transpiled to Bash and would generate all this boilerplate code for me. There is https://batsh.org/ which has a nice syntax but it doesn't even support pipes or redirection, making it pretty worthless for shell scripting. I haven't found any other such scripting languages.

  • CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  • ShellCheck

    ShellCheck, a static analysis tool for shell scripts

    >The secret sauce is a pseudo-signal provided by bash, called EXIT, that you can trap; commands or functions trapped on it will execute when the script exits for any reason.

    "Secret Sauce", why is this secret at all.

    Nothing against the author who's helping the ecosystem here, but is there an authoritative guide on Bash that anyone can recommend?

    Hopefully something that's portable between Mac & Linux.

    The web is full of contradictory guides and shellcheck seems to be the last line of defense.

    - https://github.com/koalaman/shellcheck

  • scripting-field-guide

    A booklet on mid-advanced scripting techniques

    I couldn't find a way to have more than one callback per signal, and created a system to have an array of callbacks:

    https://github.com/kidd/scripting-field-guide/blob/master/bo...

    A nice bonus is that it also keeps the return value of the last non-callback function, so your script behaves better when called from other scripts.

  • Gradle

    Adaptable, fast automation for all

    "gradle,https://gradle.org"

  • KeenWrite

    Discontinued Free, open-source, cross-platform desktop Markdown text editor with live preview, string interpolation, and math.

    https://github.com/DaveJarvis/keenwrite/blob/main/scripts/bu...

    My template script provides a way to make user-friendly shell scripts. In a script that uses the template, you define the dependencies and their sources:

        DEPENDENCIES=(

  • warp

    Create self-contained single binary applications (by Reisz)

    "warp-packer,https://github.com/Reisz/warp/releases"

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Setting up linters in Gitlab CI for C++ and Groovy / Jenkins code

    1 project | dev.to | 3 May 2024
  • Gradle's leaky abstractions: Declarative(ish) shell, imperative core: Implementing a safe(ish) global configuration DSL

    2 projects | dev.to | 24 Mar 2024
  • Working with Environment Variables in Java

    3 projects | dev.to | 22 Mar 2024
  • Intro to Java Question

    3 projects | /r/javahelp | 4 Dec 2023
  • OpenJDK JDK 21 GA Release

    1 project | /r/java | 22 Sep 2023