the /etc/rundeck/profile in RPM packaging has syntax error #2089

Closed
ahonor opened this Issue Sep 28, 2016 · 4 comments

Projects

None yet

4 participants

@ahonor
Contributor
ahonor commented Sep 28, 2016

The rd commands show errors like so:

==> rundeck: /etc/rundeck/profile: line 21: [: argument expected

Here is line 21

@gschueler gschueler added this to the 2.6.10 milestone Sep 28, 2016
@gschueler
Contributor
@plambert

You might run shell scripts through shellcheck (http://shellcheck.net/) to find likely issues with accuracy and maintainability.

It's a lifesaver for code like this that should be written once, tested once, and then forgotten because it never needs to be changed in any significant way. :)

In addition, is the -n argument to test (a.k.a. [) available in a Bourne or POSIX shell? I always thought it was bash specific. It isn't noted as a problem by shellcheck, so I might be wrong.

@fbacchella fbacchella pushed a commit to fbacchella/rundeck that referenced this issue Sep 29, 2016
Fabrice Bacchella Fix issue #2089 and some [shellcheck](http://shellcheck.net) warning 7cd124f
@fbacchella

The script fails in a strange case: there is a defined JAVA_HOME, but no executable bin/java in it. Anyway it should not fail in such a way.

-n is one of the most low level test option, see: test specifications in posix.

But not -a, I will remove it. The recommendation from shellcheck about replacing 'for' using a ' | while read' loop is wrong because variable modification inside such a loop are done in a subshell, because of the |, and don't goes to the top level.

I have fixed that in #2091

@fbacchella fbacchella pushed a commit to fbacchella/rundeck that referenced this issue Sep 29, 2016
Fabrice Bacchella Fix issue #2089 and some [shellcheck](http://shellcheck.net) warning c86dd38
@fbacchella fbacchella pushed a commit to fbacchella/rundeck that referenced this issue Sep 29, 2016
Fabrice Bacchella Fix issue #2089 and some [shellcheck](http://shellcheck.net) warning 9e4771c
@gschueler
Contributor

for #2030

@gschueler gschueler closed this Oct 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment