You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Luca Burgazzoli (JIRA)" <ji...@apache.org> on 2016/02/29 17:32:18 UTC
[jira] [Commented] (KARAF-4371) karaf shell scripts use "local"
which is not a posix compliant
[ https://issues.apache.org/jira/browse/KARAF-4371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15172090#comment-15172090 ]
Luca Burgazzoli commented on KARAF-4371:
----------------------------------------
I wiull provide a PR
> karaf shell scripts use "local" which is not a posix compliant
> --------------------------------------------------------------
>
> Key: KARAF-4371
> URL: https://issues.apache.org/jira/browse/KARAF-4371
> Project: Karaf
> Issue Type: Bug
> Components: karaf-os-integration
> Reporter: Luca Burgazzoli
> Priority: Minor
>
> karaf shell scripts use "local" in function pathCanonical which is not posix compliant:
> {code}
> pathCanonical() {
> local dst="${1}"
> while [ -h "${dst}" ] ; do
> ls=`ls -ld "${dst}"`
> link=`expr "$ls" : '.*-> \(.*\)$'`
> if expr "$link" : '/.*' > /dev/null; then
> dst="$link"
> else
> dst="`dirname "${dst}"`/$link"
> fi
> done
> local bas=`basename "${dst}"`
> local dir=`dirname "${dst}"`
> if [ "$bas" != "$dir" ]; then
> dst="`pathCanonical "$dir"`/$bas"
> fi
> echo "${dst}" | sed -e 's#//#/#g' -e 's#/./#/#g' -e 's#/[^/]*/../#/#g'
> }
> {code}
> As a consequence the script fails on non-bash shells:
> {code}
> bin/karaf[169]: local: not found [No such file or directory]
> bin/karaf[179]: local: not found [No such file or directory]
> bin/karaf[180]: local: not found [No such file or directory]
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)