Dummy command in windows cmd

余生长醉 提交于 2019-12-10 12:40:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!