karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Brüssow (JIRA) <j...@apache.org>
Subject [jira] [Updated] (KARAF-5190) start.sh fails in realpath function under Solaris 10
Date Fri, 09 Jun 2017 09:52:18 GMT

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

Christian Brüssow updated KARAF-5190:
-------------------------------------
    Description: 
Trying to start Apache Karaf 4.0.9 under Solaris 10 (SPARC) the start-script exits with a
syntax error:
{quote}
$ /opt/test/karaf/bin/start: syntax error at line 22: `LINK=$' unexpected
{quote}

I have investigated this and found, the script relies on a feature the standard awk for this
plattform does not support - at least on our machine. The \-F"\-> " paramter will only
use the dash "\-" as the field separator. When using the XPG4 version of awk the script works.

Examples on the command line:

With XPG4 awk:
{quote}
$ ls \-l "$(basename ".bashrc")" | /usr/xpg4/bin/awk \-F"\-> " '\{print $2\}'

$ 
{quote}

Empty output, which is fine as the file used is no link.


With the standard awk:
{quote}
$ ls \-l "$(basename ".bashrc")" | /usr/bin/awk \-F"\-> " '\{print $2\}'
rw
$
{quote}

The "rw" is returned, because only the dash is used as a seperator to split "ls \-l .bashrc"
which looks like
{quote}
\-rw\-r\-\-r\-\-   1 devel    other        392 Jun 30  2015 .bashrc
{quote}
in this case.


Sadly, under Solaris, one should not presume the awk in the PATH is a GNU or nawk. Some adminstrator
will also not include the XPG4 "bin"-directory at the beginning of the PATH. So the script
itfself must handle this.


  was:
Trying to start Apache Karaf 4.0.9 under Solaris 10 (SPARC) the start-script exits with a
syntax error:

/opt/test/karaf/bin/start: syntax error at line 22: `LINK=$' unexpected

I have investigated this and found, the script relies on a feature the standard awk for this
plattform does not support - at least on our machine. The -F"-> " paramter will only use
the dash "-" as the field separator. When using the XPG4 version of awk the script works.

Examples on the command line:

With XPG4 awk:
{code}
$ ls -l "$(basename ".bashrc")" | /usr/xpg4/bin/awk -F"-> " '{print $2}'

$ 
{code}

Empty output, which is fine as the file used is no link.


With the standard awk:
{code}
$ ls -l "$(basename ".bashrc")" | /usr/bin/awk -F"-> " '{print $2}'
rw
$
{code}

The "rw" is returned, because only the dash is used as a seperator to split
{code}
"ls -l" .bashrc, which looks like "-rw-r--r--   1 devel    other        392 Jun 30  2015 .bashrc"
{code}
in this case.


Sadly, under Solaris, one should not presume the awk in the PATH is a GNU or nawk. Some adminstrator
will also not include the XPG4 "bin"-directory at the beginning of the PATH. So the script
itfself must handle this.



> start.sh fails in realpath function under Solaris 10
> ----------------------------------------------------
>
>                 Key: KARAF-5190
>                 URL: https://issues.apache.org/jira/browse/KARAF-5190
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.0.9
>         Environment: SunOS 5.10 (aka Solaris 10) SPARC, awk from /usr/bin
>            Reporter: Christian Brüssow
>
> Trying to start Apache Karaf 4.0.9 under Solaris 10 (SPARC) the start-script exits with
a syntax error:
> {quote}
> $ /opt/test/karaf/bin/start: syntax error at line 22: `LINK=$' unexpected
> {quote}
> I have investigated this and found, the script relies on a feature the standard awk for
this plattform does not support - at least on our machine. The \-F"\-> " paramter will
only use the dash "\-" as the field separator. When using the XPG4 version of awk the script
works.
> Examples on the command line:
> With XPG4 awk:
> {quote}
> $ ls \-l "$(basename ".bashrc")" | /usr/xpg4/bin/awk \-F"\-> " '\{print $2\}'
> $ 
> {quote}
> Empty output, which is fine as the file used is no link.
> With the standard awk:
> {quote}
> $ ls \-l "$(basename ".bashrc")" | /usr/bin/awk \-F"\-> " '\{print $2\}'
> rw
> $
> {quote}
> The "rw" is returned, because only the dash is used as a seperator to split "ls \-l .bashrc"
which looks like
> {quote}
> \-rw\-r\-\-r\-\-   1 devel    other        392 Jun 30  2015 .bashrc
> {quote}
> in this case.
> Sadly, under Solaris, one should not presume the awk in the PATH is a GNU or nawk. Some
adminstrator will also not include the XPG4 "bin"-directory at the beginning of the PATH.
So the script itfself must handle this.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message