I hava a Makefile which needs to extract some information from a textfile `someText.txt by using awk. Here is an example:
Executing awk on my textfile manually in the console works pretty fine:
$ cat someText.txt | awk '/Total number:/ {print $NF}'
$ 42
But using it in my makefile does not work:
MYVAR=$(shell cat someText.txt | awk '/Total number:/ {print $NF}')
all:
@echo Count: $(MYVAR)
The output is: Count:
But I would suggest the output is Count: 42