From issues-return-29876-apmail-karaf-issues-archive=karaf.apache.org@karaf.apache.org Thu Jun 9 13:19:22 2016 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 E17C2187D0 for ; Thu, 9 Jun 2016 13:19:21 +0000 (UTC) Received: (qmail 1511 invoked by uid 500); 9 Jun 2016 13:19:21 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 1381 invoked by uid 500); 9 Jun 2016 13:19:21 -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 1234 invoked by uid 99); 9 Jun 2016 13:19:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2016 13:19:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 644F32C1F68 for ; Thu, 9 Jun 2016 13:19:21 +0000 (UTC) Date: Thu, 9 Jun 2016 13:19:21 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KARAF-4566) "karaf" script invokes /bin/sh but requires /bin/bash functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KARAF-4566?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1532= 2476#comment-15322476 ]=20 ASF subversion and git services commented on KARAF-4566: -------------------------------------------------------- Commit bad4ba4732bd8991342e38a94ead689d83fa1412 in karaf's branch refs/head= s/karaf-4.0.x from [~jbonofre] [ https://git-wip-us.apache.org/repos/asf?p=3Dkaraf.git;h=3Dbad4ba4 ] [KARAF-4566] Cleanup in script. This closes #197 > "karaf" script invokes /bin/sh but requires /bin/bash functions > ---------------------------------------------------------------- > > Key: KARAF-4566 > URL: https://issues.apache.org/jira/browse/KARAF-4566 > Project: Karaf > Issue Type: Bug > Components: karaf-core > Affects Versions: 3.0.6 > Environment: Solaris (SunOS solaris11.3 5.11 11.3 i86pc i386 i86p= c) > Reporter: Alexis de Talhou=C3=ABt > Assignee: Jean-Baptiste Onofr=C3=A9 > Fix For: 4.1.0, 3.0.7, 4.0.6 > > > The bin/karaf script uses the "local" command which is a shell builtin of= bash and similar shells, but is not required for POSIX-compliance in sh. W= hen I attempt to run karaf on a Solaris system, I see the following output: > root@solaris:/opendaylight/bin# ./karaf > ./karaf[172]: local: not found [No such file or directory] > ./karaf[182]: local: not found [No such file or directory] > ./karaf[183]: local: not found [No such file or directory] > Lines 172, 182 and 183 invoke "local" to make local variables to the func= tion. According to "man bash", this is a shell builtin. However, bin/karaf = is invoked as: > #!/bin/sh > On most flavors of linux, this resolves to bash or dash which probably ru= ns in a restricted environment after checking to see that its $0 is sh. But= on Solaris's /bin/sh is actually ksh93 for backwards compatibility. > Since "local" is not part of a POSIX-compliant /bin/sh, depending on it i= n a script that is invoked with /bin/sh is a bug. > (this explaination is borrowed from https://issues.apache.org/jira/browse= /MNG-5852) -- This message was sent by Atlassian JIRA (v6.3.4#6332)