Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sh: 1: [: missing ] #1595

Closed
BETLOG opened this issue Nov 22, 2023 · 2 comments
Closed

sh: 1: [: missing ] #1595

BETLOG opened this issue Nov 22, 2023 · 2 comments

Comments

@BETLOG
Copy link

BETLOG commented Nov 22, 2023

Describe the bug
sh: 1: [: missing ]

I dont understand the cause of this.

Date: Wed, 22 Nov 2023 07:36:01 +1000 (AEST)
From: Cron Daemon <root@betlognuc.lan>
To: root@betlognuc.lan
Subject: Cron <munin@betlognuc> if [ -x /usr/bin/munin-cron ]; then /usr/bin/munin-cron; fi

sh: 1: [: missing ]
sh: 1: [: missing ]

The logic seems to be functional:

user@betlognuc:~$ which munin-cron
/usr/bin/munin-cron
user@betlognuc:~$ [ -x /usr/bin/munin-cron ] && echo yes
yes
user@betlognuc:~$ [[ -x /usr/bin/munin-cron ]] && echo yes
yes
user@betlognuc:~$  if [ -x /usr/bin/munin-cron ]; then echo yes;fi
yes

Kubuntu 23.10
Chrome Version 119.0.6045.159 (Official Build) (64-bit)
This page was generated by Munin version 2.0.57 at 2023-11-17 11:05:41+1000 (AEST).

@kenyon
Copy link
Member

kenyon commented Nov 22, 2023

Try with test instead like

if test -x /usr/bin/munin-cron; then /usr/bin/munin-cron; fi

Or maybe you need to quote the whole line that you have in the munin config. Can you add your munin config where you're trying to have this logic, to the issue?

@BETLOG
Copy link
Author

BETLOG commented Nov 22, 2023

I didn't know where it was coming from. I should have know to check munin.conf again, i pretty much have it permanently open.
The problem was a trailing backslash.

        pizerocam3_acpi=pizerocam3:acpi.thermal_zone0 \
        pi4b_acpi=pi4b:acpi.thermal_zone0 \
#        pizerocam4_acpi=pizerocam4:acpi.thermal_zone0 \

@BETLOG BETLOG closed this as completed Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants