Reputation:
I'm having problems when using paste
with parentheses inside Makefile.
The instruction I'm trying to run is:
paste -d " " <(cat file1) <(cat file2 | grep "pattern")
If I run it from the console it works correctly, however when putting it inside a Makefile the parenthesis causes a syntax error:
/bin/sh: -c: line 0: syntax error near unexpected token `('
Basically what I need is to paste the contents of two (or more) files but filtering some of them with grep.
Upvotes: 3
Views: 723
Reputation: 241918
You have to tell make what shell you want to use. The default one (/bin/sh
) does not support the process substitution syntax. Put
SHELL := /bin/bash
somewhere at the top of the Makefile.
Upvotes: 6