[Top][All Lists]

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

Re: Problem with FOR statements in command lines?

From: Scott Bussinger
Subject: Re: Problem with FOR statements in command lines?
Date: Thu, 23 Oct 2003 11:17:34 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3) Gecko/20030312

> Does it help to modify the command as below?
> default:
>         cmd /c for %%a in (s\*.bak) do echo %%a

No, that generates the exact same error message (you have to change it
to single %'s first).

> Try
>         $(shell for %%a in (s\*.bak) do echo %%a)

Well not exactly. If you do that you get:

   V:\todo\test>gnumake -ftest
   gnumake: Interrupt/Exception caught (code = 0xc0000005, addr = 0x4fe7c0)

which I assume is because the $(shell) expands out to a string and then
it tries to execute it which in this case it can't. Hard to tell from
the error message though. But this variation seems to work:

       cmd /c rem $(shell for %%a in (t\*.bak) do echo %%a)

where the $(shell) runs the command and all the other junk is just so
the output gets ignored.

Seems pretty kludgy though -- any reason why this doesn't work as
expected? Anyone know what that Error 2883645 means?

Thanks to everyone for the help!

reply via email to

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