#794541 bash: /etc/skel/.bashrc handles appending of /usr/sbin and /sbin to $PATH incorrectly

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Ken Yap
Date:
2015-08-04 09:00:06 UTC
Severity:
normal
#794541#5
Date:
2015-08-04 08:57:44 UTC
From:
To:
Dear Maintainer,

While examining why ~/.bashrc didn't append /usr/sbin:/sbin to $PATH as
advertised at the bottom of the file I found that it had a logic error. It
reads:

[ -z "${PATH##*/sbin*}" ] && PATH=$PATH:/sbin:/usr/sbin

If $PATH doesn't contain /sbin, then no subsitution happens and the resulting
string is non-zero length so fails -z so the assignment doesn't happen. It
should read:

[ -n "${PATH##*/sbin*}" ] && PATH=$PATH:/sbin:/usr/sbin

An alternative fix is to change && to ||.

I'm using AntiX-15-V. It is possible that the bash package is a downstream one.