Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 62621200B25 for ; Wed, 8 Jun 2016 23:53:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 61406160A0E; Wed, 8 Jun 2016 21:53:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AABC3160A2E for ; Wed, 8 Jun 2016 23:53:26 +0200 (CEST) Received: (qmail 19950 invoked by uid 500); 8 Jun 2016 21:53:25 -0000 Mailing-List: contact dev-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 dev@karaf.apache.org Received: (qmail 19938 invoked by uid 99); 8 Jun 2016 21:53:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jun 2016 21:53:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7A5A6E0159; Wed, 8 Jun 2016 21:53:25 +0000 (UTC) From: adetalhouet To: dev@karaf.apache.org Reply-To: dev@karaf.apache.org Message-ID: Subject: [GitHub] karaf pull request #197: KARAF-4566 "karaf" script invokes /bin/sh but requi... Content-Type: text/plain Date: Wed, 8 Jun 2016 21:53:25 +0000 (UTC) archived-at: Wed, 08 Jun 2016 21:53:27 -0000 GitHub user adetalhouet opened a pull request: https://github.com/apache/karaf/pull/197 KARAF-4566 "karaf" script invokes /bin/sh but requires /bin/bash functions 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. When 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 function. 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 runs 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 in a script that is invoked with /bin/sh is a bug. (this explaination is borrowed from https://issues.apache.org/jira/browse/MNG-5852) Signed-off-by: Alexis de Talhouët You can merge this pull request into a Git repository by running: $ git pull https://github.com/adetalhouet/karaf solaris-bash-local Alternatively you can review and apply these changes as the patch at: https://github.com/apache/karaf/pull/197.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #197 ---- commit bbbb9469d4a30d21d8c0418d1200d93e8951a8f9 Author: Alexis de Talhouët Date: 2016-06-08T21:51:18Z KARAF-4566 "karaf" script invokes /bin/sh but requires /bin/bash functions Signed-off-by: Alexis de Talhouët ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---