Closed martinvahi closed 1 month ago
@martinvahi In what OS bash would not be in /bin/bash ? Thanks.
@martinvahi In what OS bash would not be in /bin/bash ? Thanks.
In NixOS. Getting very popular.
#!/usr/bin/env bash
always works.
In what OS bash would not be in /bin/bash?
I don't know them all, but Q4OS Linux and Ubuntu at my LAN use the path of
/usr/bin/bash
They are both Debian based distros. Their "uname -a" values:
Linux terminal01 6.1.0-17-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.69-1 (2023-12-30) x86_64 GNU/Linux
Linux failiserver01 6.5.0-44-generic #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jun 18 14:36:16 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Here's a session citation from FreeBSD console:
$ which bash
/usr/local/bin/bash
$ uname -a
FreeBSD fuajee 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC amd64
$
There's also a Linux distributiion that is an Android application called Termux, which has Linux/GNU command line tools, but for some reason uses a BSD package manager. On Termux console the "which bash" gives
/data/data/com.termux/files/usr/bin/bash
Thank You for reading my comment :-)
@martinvahi please take note that you can for instance have which
output something like this
and still have bash
in both paths
Fixed with PR 888 merged on dev branch.
The Bash interpreter may be at different paths at different Linux/BSD/Some_other_Unix distributions. To make Bash scripts to work with all of them, the 1. line at Bash files, the one that starts with the "#!" should be
in stead of the current
Thank You for reading this bug report :-)