Why are ksh and mksh not using alternatives system?
Issue
- BUG RHEL7 ksh and mksh not using alternatives
- I've noticed that ksh and mksh are not using the alternatives system which will cause problems with our scripts who need to switch one to the other. Is this deliberate or an oversight?
[root@shou18lkvm8 ~]# alternatives --display ksh
[root@shou18lkvm8 ~]# rpm -q --scripts ksh
postinstall scriptlet (using /bin/sh):
if [ ! -f /etc/shells ]; then
echo "/bin/ksh" > /etc/shells
else
if ! grep -q '^/bin/ksh$' /etc/shells ; then
echo "/bin/ksh" >> /etc/shells
fi
fi
/bin/systemctl try-restart systemd-binfmt.service >/dev/null 2>&1 || :
postuninstall scriptlet (using /bin/sh):
if [ ! -f /bin/ksh ]; then
sed -i '/^\/bin\/ksh$/ d' /etc/shells
fi
verify scriptlet (using /bin/sh):
echo -n "Looking for ksh in /etc/shells... "
if ! grep '^/bin/ksh$' /etc/shells > /dev/null; then
echo "missing"
echo "ksh missing from /etc/shells" >&2
else
echo "found"
fi
[root@shou18lkvm8 ~]# rpm -q --scripts mksh
postinstall scriptlet (using /bin/sh):
grep -q "^/bin/mksh$" /etc/shells 2>/dev/null || \
echo "/bin/mksh" >> /etc/shells
postuninstall scriptlet (using /bin/sh):
if [ ! -x /bin/mksh ]; then
sed -e 's@^/bin/mksh$@POSTUNREMOVE@' -e '/^POSTUNREMOVE$/d' -i /etc/shells
fi
[root@shou18lkvm8 ~]#
Environment
- Red Hat Enterprise Linux 7
- ksh-20120801-4.el7.x86_64
- mksh-41-1.el7.x86_64
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
