karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (KARAF-4593) karaf script contains error in $JAVA variable
Date Wed, 20 Jul 2016 15:56:20 GMT

     [ https://issues.apache.org/jira/browse/KARAF-4593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Guillaume Nodet updated KARAF-4593:
-----------------------------------
    Affects Version/s:     (was: 4.0.5)
                       4.0.4

> karaf script contains error in $JAVA variable
> ---------------------------------------------
>
>                 Key: KARAF-4593
>                 URL: https://issues.apache.org/jira/browse/KARAF-4593
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-shell
>    Affects Versions: 4.0.4
>         Environment: Windows, Linux
>            Reporter: Daniel Peon
>            Assignee: Guillaume Nodet
>            Priority: Minor
>             Fix For: 4.1.0, 4.0.6
>
>
> Hi,
> I found a problem executing any script which launches karaf script.
> The variable $JAVA is used without being quoted, so when Java is installed in a folder
with spaces (so common in Windows), the script will complain with the message:
> <path_to_script>/karaf: line 239: [: : integer expression expected
> This line corresponds to this part of the code:
> >>> if [ "$VERSION" -lt "80" ]; then
> This $VERSION variable was set 2 lines before as follows:
> >>>VERSION=`$JAVA -version 2>&1 | egrep '"([0-9].[0-9]\..*[0-9]).*"'
| awk '{print substr($3,2,length($3)-2)}' | awk '{print substr($1, 3, 3)}' | sed -e 's;\.;;g'`
> That variable $JAVA should be quoted so that it allows spaces in the path to Java installation.
> Kind regards.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message