问题
In linux we have a 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 for 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.
来源:https://stackoverflow.com/questions/7190536/dummy-command-in-windows-cmd