Wednesday, July 17, 2013

Makefile,pipes,awk,shell assignment, and $$1, oh my...

>>> On 9/5/2012 7:02 PM, Tim Daneliuk wrote:
...
>> 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
Somewhat OT: Using Pipes Inside a GNU Make File

'via Blog this'

2 comments: