On Friday 30 December 2005 02:25 pm, Ed Shaw wrote:
> Hi,
>
> I'm just new to this stuff and can't figure it out.
>
>
> Now I have done the same thing in a make file:
>
> Contents of t.mak:
>
> #!/bin/sh
    ^^^^
Get rid of this.

>
> test:
>       for i in one two three; do echo "$i"; done
>
>
>
> So, the shell program works and echos out one two three.  The make
> file echos out 3 blank lines.  Why?
>

I know this *must* be documented somewhere... 

The i variable is not a make variable, but a shell variable. You need to 
escape it with two $s. That is,

    for i in one two three; do echo $$i; done


  --Eric


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to