请翻译一下这个*。蝙蝠片段是说(只有一个短线) [英] Please translate what this *.bat snippet is saying (only one short line)

查看:94
本文介绍了请翻译一下这个*。蝙蝠片段是说(只有一个短线)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发现定时器此批处理文件。我不是很熟悉,* .bat文件,但有foundout以下

found this batch file with timer. I'm not very familiar with *.bat files but have foundout the following

这01秒中的时间

PING -n 01 127.0.0.1>nul 

但林不知道剩下的手段而不是随便去使用它可能有人请解释一下在这个片段中所有其他项目做/再present

however im not sure what the rest means rather then just go and use it could someone please explain what all other items in this snippet do/ represent

感谢

推荐答案

这是一个<一个href=\"http://stackoverflow.com/questions/245395/underused-features-of-windows-batch-files/245455#245455\">sneaky 睡眠语句。我用它之前得到了的cmd.exe 脚本的延迟,而不必求助于外部工具。

It's a sneaky sleep statement. I've used it before to get a delay in a cmd.exe script without having to resort to external utilities.

然而,

ping -n 21 127.0.0.1 >nul:

通常会为大家介绍一款的 20 的秒钟的延迟,因为第一次ping立即熄灭(只有后续坪有1秒的延迟后发送)。

will generally give you about a 20 second delay because the first ping goes out immediately (only the subsequent pings are sent after a 1-second delay).

如果你试试你的变种(与 01 )未经&GT; NUL 位,你会看到它立即返回。如果用 21 试试吧,它需要大约20秒,你就会明白为什么,希望: - )

If you try your variant (with 01) without the >nul bit, you'll see it returns immediately. If you try it with 21, it should take about 20 seconds, and you'll see why, hopefully :-).

至于什么所有位的意思是:

As to what all the bits mean:


  • 是平的可执行文件,目的是检查是否可以与特定的IP地址进行通信(它是那么有用比你想象的,因为许多网站会阻止ICMP(平)包同时仍然允许真实流量。

  • -n 21 表示尝试21次(每间一秒,但你可以改变另一个参数)。

  • 127.0.0.1 是环回地址,基本上都是这台计算机。所以没有网络延迟介绍您ping自己的计算机(并不在乎你的目标,如果每个人在这个星球上决定使用 slashdot.org 为例)。

  • 方式&gt; NUL 只是意味着发送所有输出到比特斗,所以你看不到它在控制台上

  • ping is the ping executable, meant to check whether you can communicate with a specific IP address (it's less useful than you think since many sites will block ICMP (ping) packets while still allowing real traffic.
  • -n 21 means to try 21 times (with one second between each, although you can change that with another parameter).
  • 127.0.0.1 is the loopback address, basically "this computer". You ping your own computer so that no network delays are introduced (and to not annoy your target if everyone on the planet decided to use slashdot.org for example).
  • >nul just means to send all the output to the bit-bucket so you don't see it on the console.

这篇关于请翻译一下这个*。蝙蝠片段是说(只有一个短线)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆