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

crm report does not work with dash #164

Closed
vvidic opened this issue Nov 2, 2016 · 5 comments
Closed

crm report does not work with dash #164

vvidic opened this issue Nov 2, 2016 · 5 comments

Comments

@vvidic
Copy link
Contributor

vvidic commented Nov 2, 2016

Default shell in Debian is dash rather than bash and this does not work as expected with the hb_report:

# crm report -f 2am -M -E /var/log/syslog -d -s -Z
/usr/share/crmsh/hb_report/hb_report: 480: local: /var/log/syslog.1: bad variable name

The problem seems to be with backtick calls returning multiple values:

local logf_set=`arch_logs $logf $from_time $to_time`

The script should either require bash or the backtick calls need to be fixed.

@dmuhamedagic
Copy link
Collaborator

Yes, initialization won't work in local. Will fix that.

@vvidic
Copy link
Contributor Author

vvidic commented Nov 2, 2016

Thanks, quoting seems to help here:

local logf_set="`arch_logs $logf $from_time $to_time`"

However there are other backtick calls that have the same problem, so they should also be reviewed and quoted if needed.

@dmuhamedagic
Copy link
Collaborator

I just split out all initializations from local statements. If you have time, please test. Let us know if there are more problems with dash. Thanks!

@vvidic
Copy link
Contributor Author

vvidic commented Nov 2, 2016

Thanks for the quick fix, no more errors :)

@krig
Copy link
Contributor

krig commented Nov 2, 2016

Thank you both!

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

No branches or pull requests

3 participants