Git Product home page Git Product logo

bash-strict-mode's Introduction

  • 🔭 I’m currently working on GHC plugins & category theory modeling
  • 🌱 I’m currently learning enriched category theory and dependent type theory
  • 👯 I’m looking to collaborate on writing about functional programming
  • 💬 Ask me about freediving
  • 📫 How to reach me: @sellout on Mastodon.social
  • 😄 Pronouns: they/them
  • ⚡ Fun fact: I can hold my breath for four minutes.

GitHub stats

bash-strict-mode's People

Contributors

github-actions[bot] avatar renovate[bot] avatar sellout avatar

Watchers

 avatar  avatar  avatar

bash-strict-mode's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/flakehub-publish.yml
  • actions/checkout v4
nix
flake.nix
  • nixpkgs release-23.11

  • Check this box to trigger a request for Renovate to run again on this repository

macos: `strict-bash` shebang is sometimes ignored

Using #!/path/to/strict-bash sometimes results in strict-bash being ignored and bash itself interpreting the script.

According to https://stackoverflow.com/questions/9988125/shebang-pointing-to-script-also-having-shebang-is-effectively-ignored, MacOS (and other BSD-derived unices) can’t use a script as a shebang interpreter. This is extra-painful on MacOS as the bash available by default is ancient, and many scripts won't work on it.

The default shell on MacOS is ZSH, which somehow avoids this issue. Using #!/usr/bin/env strict-bash avoids it as well. However, when using this with Nix, those options are less viable. Nix doesn’t like env and instead rewrites to an absolute path to the interpreter, which breaks this behavior. Also, Nix shells tend to use Bash, not ZSH. I.e., Nix is where you start seeing this issue.

One way to avoid this would be to make strict-bash an actual binary.

In the meantime, a workaround (adapted from the Stack Overflow link above) is

#!/usr/bin/env bash
exec -o "$0" strict-bash <<EOM

... content to be executed ...
EOM

Of course, once you’re doing that, it's just as easy to use

#!/usr/bin/env bash
source strict-mode.bash

... content to be executed ...

support i686-linux

Downstream projects want to use i686, but there are currently some issues with it here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.