windows子命令评估 [英] windows subcommand evaluation
本文介绍了windows子命令评估的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
linux& unix shell可以处理这样的子命令。
$>命令`子命令
是否与Windows cmd shell类似的功能?
命令的变体来获得类似的结果:
$ b $ b
$ b $ b
FOR / Fusebackq tokens = *%% a IN(`subcommand`)DO @command %% a
一个很大的区别(除了不直观和非常丑陋),它会执行 command
一次对于子命令生成的每一行
请注意,在脚本文件中,百分号必须加倍非双倍百分比符号,如果你有一些理由想在命令行执行此操作)。
linux & unix shells can process subcommands like this.
$> command `subcommand`
does windows cmd shell similar feature?
解决方案
You can get something similar using a variation of the for
command:
FOR /F "usebackq tokens=*" %%a IN (`subcommand`) DO @command %%a
One big difference (besides being unintuitive and much uglier) is that it'll execute command
once for each line produced by subcommand
Note that inside a script file, the percent signs must be doubled up (use non-doubled percent signs if you have some reason to want to do this at the command line).
这篇关于windows子命令评估的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文