13967: [: -ne: unexpected operator
Brought to you by:
dogsbody,
dogsbodymark
Benoit Friry reported the following on the Debian tracker:
Since upgrade to 1.4.2-0.2, I get cron errors:
/etc/cron.daily/rkhunter:
/usr/bin/rkhunter: 13967: [: -ne: unexpected operator
This line is:
if [ `${IPCS_CMD} -u 2>/dev/null | awk -F' ' '/segments allocated/ {print $3}'` -ne 0 ]; then
To compare with:
# ipcs -u 2>/dev/null
------ États des messages --------
files allouées = 0
en-têtes utilisées = 0
espace utilisé = 0 octets
------ État de la mémoire partagée --------
segments alloués = 28
pages alloués = 7428
pages résidentes = 6773
pages d'échange = 0
performance de l'espace d'échange = 0 tentatives 0 succès
------ États des sémaphores --------
tableaux utilisés = 3
sémaphores alloués = 35
My default locale is French:
# cat /etc/default/locale
# File generated by update-locale
LANG="fr_FR.UTF-8"
I created a /usr/bin/rkhunter.new and forced LANG=C before line 13967,
adapted /etc/cron.daily/rkhunter, and I don't have error anymore.
I suggest using data from /proc if possible (I did not find how to get
these data from there), or force LANG=C.
This has already been fixed in the CVS version.