From owner-freebsd-questions@FreeBSD.ORG Thu Sep 6 16:16:51 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86A5B1065672 for ; Thu, 6 Sep 2012 16:16:51 +0000 (UTC) (envelope-from tundra@tundraware.com) Received: from ozzie.tundraware.com (ozzie.tundraware.com [75.145.138.73]) by mx1.freebsd.org (Postfix) with ESMTP id 429A28FC08 for ; Thu, 6 Sep 2012 16:16:49 +0000 (UTC) Received: from [10.219.130.72] ([66.175.245.1]) (authenticated bits=0) by ozzie.tundraware.com (8.14.5/8.14.5) with ESMTP id q86GGd8u099587 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Thu, 6 Sep 2012 11:16:39 -0500 (CDT) (envelope-from tundra@tundraware.com) Message-ID: <5048CC88.4030107@tundraware.com> Date: Thu, 06 Sep 2012 11:17:12 -0500 From: Tim Daneliuk Organization: TundraWare Inc. User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 CC: freebsd-questions@freebsd.org References: <5047E804.7050406@tundraware.com> <5047ED29.2040001@shatow.net> <50480361.8030601@tundraware.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (ozzie.tundraware.com [75.145.138.73]); Thu, 06 Sep 2012 11:16:40 -0500 (CDT) X-TundraWare-MailScanner-Information: Please contact the ISP for more information X-TundraWare-MailScanner-ID: q86GGd8u099587 X-TundraWare-MailScanner: Found to be clean X-TundraWare-MailScanner-From: tundra@tundraware.com X-Spam-Status: No Subject: Re: Somewhat OT: Using Pipes Inside a GNU Make File X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: tundra@tundraware.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 16:16:51 -0000 On 09/05/2012 09:15 PM, Warren Block wrote: > On Wed, 5 Sep 2012, Tim Daneliuk wrote: > >> On 09/05/2012 07:24 PM, Bryan Drewery wrote: >>> On 9/5/2012 7:02 PM, Tim Daneliuk wrote: >>>> A bit off topic, but I'm kind of stuck. I am using gmake and want to >>>> do something like this: >>>> >>>> FOO := $(shell a | b | c) >>>> >>>> But this appears not to work. Only the 'a' command is executed. The >>>> remainder >>>> of the pipeline is ignored. Is there some clean way to implement this >>>> kind of thing? >>>> >>>> >>> >>> I use this in a GNUMakefile and it works fine. >>> >>> BRANCH := $(shell git branch --no-color | grep "^*" | sed -e 's/^\* //') >>> >>> >>> You may need to post a more specific example. >>> >>> Bryan> _______________________________________________ >> >> Here's the line that is failing: >> >> 2LATEX = $(shell which rst2latex.py rst2latex | tr '\012' ' ' | awk '{print $1}') --stylesheet=parskip > > Bryan's example is using := for assignment. That wasn't it, as it turned out. The problem was in the awk statement. Instead of: awk '{print $1}' I had to use: awk '{print $$1}' This is necessary because $1 is a *make* variable but $$1 is the awk variable I wanted ($1).... D'uh .... ----------------------------------------------------------------------- Tim Daneliuk