其他分享
首页 > 其他分享> > test

test

作者:互联网

一 基本语法

(1)基础

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70.png)

① 基本语法

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602074124.png)

② 处理文件

备注:处理的是'文件',而不是'文件的内容-->/f'

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602074125.png)

③ 变量扩展

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602074126.png)

④ for技巧

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602074127.png)

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602074128.png)

(2)目录

备注:目录-->'d:directory'关于目录的操作

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602074129.png)

(3)递归

recursion -->'r' -->'递归'

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602075130.png)

需求:递归的'查找'文件

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602075131.png)

(4)*序列*

该集表示以"增量形式"从'开始到结束'的一个"数字序列"



 



L -->'list' -->'l'

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602075132.png)

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602075133.png)

(5)*文件内容*

① 基本语法

/f -->'File' -->"文件内容"

让cmd拥有Linux的tail功能zip![img](windows bat.assets/star.png)0星超过10%的资源3KB![img](windows bat.assets/arrowDownWhite.png)下载

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602075134.png)

② 总options

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602075135.png)

③ eol

注意:eol只能是'一个字符','忽略'以'only character'开头的行

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602075136.png)

④ skip

效果:跳过前'n'行,从文件的第'n+1'行开始

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602076137.png)

⑤ tokens

理解:指定"列"提取

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602076138.png)

![img](windows bat.assets/20210516222733906.png)

![img](windows bat.assets/20210516222841422.png)

cmd网络命令txt![img](windows bat.assets/star.png)0星超过10%的资源66.0B![img](windows bat.assets/arrowDownWhite.png)下载

![img](windows bat.assets/20210516222920942.png)

⑥ delims

'分隔符' delimeter -->可以是一个'set集合'



 



类似:awk的'-F'参数

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602076139.png)

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602076140.png)

⑦ usebackq

说明:"了解"这个参数即可

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602076141.png)

⑧ 特殊字符

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602076142.png)

⑨ 注意事项

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602076143.png)

![img](windows bat.assets/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d6al8xMTA=,size_16,color_FFFFFF,t_70-1659510602076144.png)

标签:bat,assets,img,windows,text,test,png
来源: https://www.cnblogs.com/siysun/p/16547296.html