Dummy command in windows cmd

2019-06-15 13:53发布

问题:

In linux we have makefile:

$(foreach A,a b,echo $(A) &&) true

It works and echos

a
b

Now we want to port it to Windows. The shortest command I've found in Windows that does nothing:

if 0==1 0

So the makefile example will look like

$(foreach A,a b,echo $(A) &&) if 0==1 0

Is there any dummy command in Windows in box (that really does nothing)? Or any nice hack?

回答1:

The rem command does nothing.



回答2:

The call command without any argument does nothing and has no collateral effect as rem has.

Example:

echo Wait for it...
call
echo Nothing happened!


回答3:

Old thread, new answer.

I have been using cd. when I want to do nothing in windows (and I often do) since "change directory to itself" has no side effects at all as far as I can see.