#1145985 false positive … hash is POSIX

#1145985#5
Date:
2026-08-28 14:15:31 UTC
From:
To:
When checking https://github.com/trip-zip/somewm/blob/main/contrib/systemd/somewm-session.sh I got an error:

$ checkbashisms contrib/systemd/somewm-session.sh
possible bashism in contrib/systemd/somewm-session.sh line 29 (hash):
if ! hash systemctl >/dev/null 2>&1; then
possible bashism in contrib/systemd/somewm-session.sh line 62 (hash):
if hash dbus-update-activation-environment 2>/dev/null; then
$

That is not correct, `hash` is part of POSIX [1]. See also the discussion on https://github.com/trip-zip/somewm/pull/717.

Best,

Matěj

[1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/hash.html