From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mxout32.expurgate.net ([91.198.224.32]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1YPJ9W-0002I0-Br for ptxdist@pengutronix.de; Sun, 22 Feb 2015 00:08:04 +0100 Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.80.1) (envelope-from ) id 1YPJ9R-0004Ye-5H for ptxdist@pengutronix.de; Sun, 22 Feb 2015 00:07:57 +0100 Received: from [149.211.153.213] (helo=srv1731.hp.thyssenkrupp.com) by relay.expurgate.net with esmtps (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.80.1) (envelope-from ) id 1YPJ9Q-0008Cz-NZ for ptxdist@pengutronix.de; Sun, 22 Feb 2015 00:07:56 +0100 Received: from localhost (localhost [127.0.0.1]) by srv1731.hp.thyssenkrupp.com (Postfix) with ESMTP id 520F85CB90 for ; Sun, 22 Feb 2015 00:07:56 +0100 (CET) Received: from mail.tkecene.com (unknown [10.84.160.134]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by srv1731.hp.thyssenkrupp.com (Postfix) with ESMTPS id 3E33E5C9E9 for ; Sun, 22 Feb 2015 00:07:56 +0100 (CET) From: =?iso-8859-1?Q?R=FCdiger=2C_Christoph?= Date: Sat, 21 Feb 2015 23:07:55 +0000 Message-ID: <1E9AED858BEB204B9DE4F807C7ED0EF617CDD326@EMSRVWIN2934.apps.edc.thyssenkrupp.com> Content-Language: de-DE MIME-Version: 1.0 Subject: [ptxdist] (no subject) Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: "ptxdist@pengutronix.de" Hello, I'm trying to use ptxdist on a Mac OS X system to get rid of the Linux VM just for compiling things. Here is the thing I stumbled upon because I don't get the intention and therefore struggle to find a patch. The git commit 0dc57566bc5a25d2b086de333844a3c00addf0e4 from 2012-12-13 changed the body of the ptxd_make_log() function in scripts/libptxdist.sh from this implementation -ptxd_make_log() { - # - # fd3 == stdout to logfile - # fd4 == stderr to logfile - # fd5 == clean stdout - # fd6 == clean stderr - # - { - export PTXDIST_FD_STDOUT=5 - export PTXDIST_FD_STDERR=6 - export PTXDIST_FD_LOGFILE=7 - { - if [ -z "${PTXDIST_QUIET}" ]; then - ptxd_make "${@}" 4>&- | - # make's stdout on fd0 - tee -a "${PTX_LOGFILE}" 2>&4 4>&- 5>&- 6>&- - check_pipe_status || return - else - exec 4>&- - ptxd_make "${@}" 1>> "${PTX_LOGFILE}" - fi - } 2>&1 1>&3 3>&- 7>> "${PTX_LOGFILE}" | - # make's stderr on fd0 - tee -a "${PTX_LOGFILE}" 1>&2 3>&- 4>&- 5>&- 6>&- - check_pipe_status || return - } 3>&1 4>&2 5>&1 6>&2 -} to this implementation +ptxd_make_log() {( + # stdout only + exec {PTXDIST_FD_STDOUT}>&1 + # stderr only + exec {PTXDIST_FD_STDERR}>&2 + # logfile only + exec 9>> "${PTX_LOGFILE}" + export PTXDIST_FD_STDOUT + export PTXDIST_FD_STDERR + export PTXDIST_FD_LOGFILE=9 + + if [ -z "${PTXDIST_QUIET}" ]; then + # stdout and logfile + exec {logout}> >(tee -a "${PTX_LOGFILE}") + else + # logfile only + exec {logout}>> "${PTX_LOGFILE}" + fi + # stderr and logfile + exec {logerr}> >(tee -a "${PTX_LOGFILE}" >&2) + + ptxd_make "${@}" 1>&${logout} 2>&${logerr} +)} Now, my bash is complaining at the first exec command: > exec: {PTXDIST_FD_STDOUT}: not found To me, it looks fully understandable, because {PTXDIST_FD_STDOUT} is an ill-formed brace expansion and is therefore ignored. But why is the Linux (Ubuntu 12.04) not complaining about? What is the intention of this brace usage here? However, an > echo a{b,c,d}e expands on both machines to "abe ace ade" and an > echo {logout} gets ignored on both machines. Output is just "{logout}". Best regards, Christoph -- ThyssenKrupp Elevator Innovation GmbH PDC Neuhausen TKEI Elevator Control Bernhaeuser Str. 45 73765 Neuhausen, Germany Phone +49 7158 12-2615 christoph.ruediger@thyssenkrupp.com Company domicile: Essen Commercial register: Essen HRB 20 839 Postal address: ThyssenKrupp Allee 1, 45143 Essen, Germany Executive Board: Gerhard Thumm, Katrin Huenger, Philippe Choleau -- ptxdist mailing list ptxdist@pengutronix.de