Earlier quoted context omitted.
The Fedora base image does not include which. The base image is what's used in the standard OCI Fedora container, some Flatpak work, and some other things. Arch also doesn't include "which", nor do some arch-based distros.
Arch uses zsh in the Installation Medium and bash as default shell of the code System, both have which as a builtin function.
Which is not Posix
61–70 of 97 posts
Re: Which is not Posix
#62What a confusing title. This would have been so much clearer: which(1) is not Posix
Re: Which is not Posix
#63Earlier quoted context omitted.
This already exists: * https://en.wikipedia.org/wiki/Austin_Group * https://www.opengroup.org/austin/ * https://www.austingroupbugs.net/main_page.php * https://www.mail-archive.com/austin-group-l@opengroup.org/ma... There are drafts available for a 202x revision (have to register an account). See also: * https://unix.org/ * https://twitter.com/unixr
The problem with POSIX is that they don't work to define the fundamental necessities of a good OS, they merely document the cases where most of the distros have the same functionality with the same syntax. This ends up being only a subset of the typical functionality found on a system. Even worse is the way they can lock in old braindamage and make it harder to fix.
Re: Which is not Posix
#64Re: Which is not Posix
#65Earlier quoted context omitted.
Not all systems have bash as /bin/bash. A shebang line of '#!/usr/bin/env bash' would be even more portable.
I like bash 4+ for associative arrays, and use it on macOS. But macOS is still v3 by default (for /bin/bash). I think `/usr/bin/env bash` is a great shebang, for the record, but I'm not totally convinced that it's more portable than `/bin/bash`. Can you explain what makes it actually more portable? In absence of that, you might actually expect `/bin/bash` to be more portable, as at least you can more likely make assu…
typical GNU/Linux: /bin/bash
FreeBSD, NetBSD, OpenBSD: /usr/local/bin/bash
Solaris, Illumos, OpenIndiana, SmartOS, etc.: /usr/bin/bash
macOS: /bin/bash
NixOS, GuixSD†: /run/current-system/sw/bin/bash
but all of these operating systems have a standards-compliant `env` installed at `/usr/bin/env`.— †: GuixSD may have slightly tweaked the structure of their profiles; I'm not sure if it's at `.../sw/bin` or it's something else after the ...
Re: Which is not Posix
#66Earlier quoted context omitted.
The Fedora base image does not include which. The base image is what's used in the standard OCI Fedora container, some Flatpak work, and some other things. Arch also doesn't include "which", nor do some arch-based distros.
Arch uses zsh in the Installation Medium and bash as default shell of the code System, both have which as a builtin function.
Re: Which is not Posix
#67Earlier quoted context omitted.
which is not a thing in bourne shells; it's a separate executable. If it were a builtin then there wouldn't be a kerfuffle; there are multiple implementations of "which" and Debian doesn't want to privilege one of them, but if Debian base scripts use one, then it must privilege one of them.
It is a built-in in zsh. Thanks to that, it will recognize when something is a built-in, an alias, a function or a command and report accurately what will be executed when you type it in without the "which".
Re: Which is not Posix
#68Earlier quoted context omitted.
> Interesting. Can you be a bit more specific? What in POSIX does systemd explicitly reject? And might there be a reason for that? The project specifically rejects "caring about POSIX" in its entirety. Poettering has discussed this at length[1]. I'm not criticizing systemd here, I'm merely pointing out that Debian is already perfectly fine with shipping non-portable, aPOSIX or even anti-POSIX software by default (whi…
If Debian is perfectly fine with anti-POSIX, why go to the effort of making and switching to dash over bash? One of the impetuses for that project was bash’s inability to confirm to posix even when launched in posix mode. What’s that about?
Re: Which is not Posix
#69Earlier quoted context omitted.
I like bash 4+ for associative arrays, and use it on macOS. But macOS is still v3 by default (for /bin/bash). I think `/usr/bin/env bash` is a great shebang, for the record, but I'm not totally convinced that it's more portable than `/bin/bash`. Can you explain what makes it actually more portable? In absence of that, you might actually expect `/bin/bash` to be more portable, as at least you can more likely make assu…
>Can you explain what makes it actually more portable? POSIX. The NixOS machine I'm typing this on has /usr/bin/env but not /bin/bash.
Re: Which is not Posix
#70Earlier quoted context omitted.
Arch uses zsh in the Installation Medium and bash as default shell of the code System, both have which as a builtin function.
Except the behavior of the builtin is not the same as the behavior of the program, and Arch's base package doesn't include the which command.