且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用呼吁在一个批处理脚本标签

更新时间:2023-01-08 16:03:59

为什么不运行它,看看自己?我救了你的脚本称为foo.bat一个批处理文件,我改变了你妈妈上大学前有一个回声

Why not just run it and see for yourself? I saved your script to a batch file called foo.bat, and I changed the Your mom goes to college to have an echo in front.

C:\temp>foo

C:\temp>ECHO It's for my college fund.
It's for my college fund.

C:\temp>CALL :OMGSUB

C:\temp>echo Your mom goes to college.
Your mom goes to college.

C:\temp>GOTO:eof

C:\temp>ECHO *runs away and cries like a little girl*
*runs away and cries like a little girl*

C:\temp>echo Your mom goes to college.
Your mom goes to college.

C:\temp>GOTO:eof

C:\temp>

所以很容易地看到,经过了 OMGSUB 被调用,它


  1. 转到文件的末尾。

  2. 然后返回到线对AFER的 CALL:OMGSUB 和回声的逃跑行

  3. 然后再它的回声您妈妈行

  4. 将它转到文件结尾并终止的

  5. 回声的拿起jewewlry箱的线永远不会被达到。

  1. Goes to the end of file.
  2. Then it returns to the line right afer the CALL :OMGSUB and echos the "runs away" line
  3. Then it echos the Your Mom line again
  4. The it goes to end of file and terminates
  5. The echo picks up jewewlry box line never gets reached.