Shebangs suppose FHS-compliant system

Hey! Small “bug” report: It seems most of your shell scripts contain the shebang line:

#!/bin/bash

This makes them not work on systems such as NixOS, which are not FHS compliant. It can easily be fixed by changing the shebangs to:

#!/usr/bin/env bash

Of course, it’s not a big problem to change this myself, but I thought I’d just report this anyway :slight_smile:.

1 Like

Hey @joncol, could you confirm if the issue is specific to #!/bin/bash, or does #!/bin/sh cause the same problem on NixOS?

Just checking, did you happen to override this option in your config?

Hey! #!/bin/sh does not cause that problem. That file (a link to the nix store) is there. I did not override that option. I didn’t even think about that being possible :slight_smile:. I guess I could solve it that way also… But if you still want to “fix” this, I guess it should be a pretty safe change?

1 Like

@joncol We definitely want to get this fixed for you! Just hoping to understand the issue a bit better first. :folded_hands:

We now understand that #!/bin/bash can cause issues on NixOS, but this commit in your repo is a bit confusing:

From what I can tell, #!/bin/sh shouldn’t be a problem, and it looks like the newer your_program.sh (compared to the older your_bittorrent.sh) is already safe for NixOS:

That said, we do still need to address the presence of older scripts like your_bittorrent.sh which uses #!/bin/bash.

1 Like

You’re definitely correct, that change of #!/bin/sh was unnecessary. I did not see that it was using sh there, instead of bash

1 Like