/bin/bash
won’t work on every system
for example NixOS
some other systems may have bash in /usr/bin or elsewhere
Comment on Yes
MonkderZweite@feddit.ch 11 months agoStill don’t do this. If you use bash specific syntax with this head, that’s a bashism and causes issues with people using zsh for example. Or with Debian/*buntu, who use dash as init shell.
quantenzitrone@feddit.de 11 months ago
MonkderZweite@feddit.ch 11 months ago
NixOS didn’t do /usr merge?
quantenzitrone@feddit.de 11 months ago
Binaries are not in
/usr/bin
or/bin
except for/bin/sh
and/usr/bin/env
. Programs should not assume fixed paths for binaries and instead look for them in$PATH
.
wolo@lemmy.blahaj.zone 11 months ago
#!/bin/bash
doesn’t work on NixOS since bash is in the nix store somewhere,#!/usr/bin/env bash
resolves the correct location regardless of where bash isJackbyDev@programming.dev 11 months ago
Are there any distos with
/use/bin/env
in a different spot? I still believe that’s the best approach for getting bash.MenacingPerson@lemm.ee 11 months ago
All posix-compliant distros need /usr/bin/env
MonkderZweite@feddit.ch 11 months ago
I do think a simple symlink is superior to a tool parsing stuff. A shame POSIX choose this approach.
Still the issue that a posix shell can be on a non-posix system and vice versa. Btw, isn’t there only one posix certified Linux distro? Was it Suse?
Nobsi@feddit.de 11 months ago
My own. I use arch btw