io redirection - Makefile - Syntax error with for-loop -
in makefile, need cycle through list , write current element of list in file. code following:
shell := /bin/bash list = b c test: in $(list) \ echo $ii > file.txt \ done i next error:
/bin/bash: -c: line 1: syntax error near unexpected token `>' do know how prepare it?
you missing ; after $(list). need terminate list of words giving for before can start do block.
as indicated in comments, additionally need : @ end of echo line (the command gets run has no newlines way works @ normal command line need explicitly separate commands each other).
and further, results expect, need escape $ in shell command using $$i (also pick 1 of $i or $ii variable name).
makefile io-redirection
No comments:
Post a Comment