Return-Path: X-Original-To: apmail-karaf-issues-archive@minotaur.apache.org Delivered-To: apmail-karaf-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 638E81876A for ; Wed, 2 Mar 2016 07:08:18 +0000 (UTC) Received: (qmail 92083 invoked by uid 500); 2 Mar 2016 07:08:18 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 92057 invoked by uid 500); 2 Mar 2016 07:08:18 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 92044 invoked by uid 99); 2 Mar 2016 07:08:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Mar 2016 07:08:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 2A2D62C1F56 for ; Wed, 2 Mar 2016 07:08:18 +0000 (UTC) Date: Wed, 2 Mar 2016 07:08:18 +0000 (UTC) From: "Freeman Fang (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (KARAF-4371) karaf shell scripts use "local" which is not a posix compliant MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KARAF-4371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Freeman Fang reassigned KARAF-4371: ----------------------------------- Assignee: Freeman Fang > 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 > Assignee: Freeman Fang > 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)