No no no no no, do not believe this you will shoot yourself in the foot.
Beginning with DebianSqueeze, Debian uses Dash as the target of the /bin/sh symlink. Dash lacks many of the features one would expect in an interactive shell, making it faster and more memory efficient than Bash.
From DebianSqueeze to DebianBullseye, it was possible to select bash as the target of the /bin/sh symlink (by running dpkg-reconfigure dash). As of DebianBookworm, this is no longer supported.
MonkderZweite@feddit.ch 1 year ago
Still 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.
wolo@lemmy.blahaj.zone 1 year 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 1 year 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 1 year ago
All posix-compliant distros need /usr/bin/env
Nobsi@feddit.de 1 year ago
My own. I use arch btw
quantenzitrone@feddit.de 1 year ago
/bin/bash
won’t work on every system for example NixOS some other systems may have bash in /usr/bin or elsewhereMonkderZweite@feddit.ch 1 year 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
.