[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with for loop

From: Paul D. Smith
Subject: Re: Help with for loop
Date: Mon, 2 Jan 2006 21:01:37 -0500

%% Ed Shaw <address@hidden> writes:

  es> test:
  es>   for i in one two three; do echo "$i"; done

  es> So, the shell program works and echos out one two three.  The make file
  es> echos out 3 blank lines.  Why?

The "$i" is being interpreted as the make variable "i", which you have
not set.

Whenever you want a dollar sign ($) to appear in a script, you have to
escape it by using two of them:

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

See the GNU make manual for more details.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

[Prev in Thread] Current Thread [Next in Thread]