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

Fixes #4789: fix expression to compute run_interval in #311

Conversation

VinceMacBuche
Copy link
Member

@@ -89,7 +89,7 @@ fi


RUN_INTERVAL=`cat /var/rudder/cfengine-community/inputs/run_interval`
CHECK_INTERVAL=`expr ${RUN_INTERVAL} * 2`
CHECK_INTERVAL=`expr ${RUN_INTERVAL} "*" 2`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this workaround. My reflex would be to escape the * which is being interpreted by the shell, like this:

CHECK_INTERVAL=`expr ${RUN_INTERVAL} \* 2`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any indication that your approach has advantages over this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had no idea why escaping with " would be better, I only followed one guide that explain me to use double quote ... http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/bourne/node32.html

But in fact using \ seems better ...

" is better to escape a whole series of character, here there is only one, so using \ is better

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And just tested, no problem using backslash

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And backslash works on aix too

@VinceMacBuche
Copy link
Member Author

Made new commit with \ instead

jooooooon added a commit that referenced this pull request May 2, 2014
…k-rudder-agent

Fixes #4789: fix expression to compute run_interval in
@jooooooon jooooooon merged commit ce7c25b into Normation:branches/rudder/2.10 May 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants