早教吧作业答案频道 -->其他-->
高分虚心求教编辑一个脚本,使用sed提取指定行中匹配的内容,并按照指定格式输出文本.[root@server1]#vim/tmp/test.txtTrying192.168.0.7...^MConnectedto192.168.0.7.^MEscapecharacteris'^]'.^M1、首先提取从.这
题目详情
高分虚心求教编辑一个脚本,使用sed提取指定行中匹配的内容,并按照指定格式输出文本.
[root@server1 ]# vim /tmp/test.txt
Trying 192.168.0.7...^M
Connected to 192.168.0.7.^M
Escape character is '^]'.^M
1、首先提取从.这一行中,提取含有" "中的内容.
2、然后各行输出user online=" " ,login=" ",player count=" ",memory used=" ",free=" " ,total=" " 至mail.txt文本中.
[root@server1 ]# vim /tmp/test.txt
Trying 192.168.0.7...^M
Connected to 192.168.0.7.^M
Escape character is '^]'.^M
1、首先提取从.这一行中,提取含有" "中的内容.
2、然后各行输出user online=" " ,login=" ",player count=" ",memory used=" ",free=" " ,total=" " 至mail.txt文本中.
▼优质解答
答案和解析
grep -oP '((user online|login|player count|memory used|free|total)="([0-9]*)")' test.txt > mail.txt
看了 高分虚心求教编辑一个脚本,使...的网友还看了以下:
请帮我算下这个数独的答案,{4,2,0,0,9,0,0,0,0}{5,0,7,3,0,0,0,0, 2020-04-26 …
还是lingo问题road(country,country):length,xie,c;endse 2020-05-13 …
设f(x,y)在(0,0)处连续,limx,y→0f(x,y)-1ex2+y2-1=4,则()A. 2020-05-14 …
数列(第6题3小题)计算0.1+0.2+0.3+0.4+0.5+0.6+0.7+0.8+0.9+0 2020-05-17 …
ansys直接建立有限元模型问题finish/clear/prep7n,1,0,0,0n,2,0, 2020-05-17 …
14.5-2(t+3)/5=0.15t/0.1-0.4t-2.8/0.6教教我吧快解方程不要只有一 2020-05-22 …
0.9*0.9*0.9*0.9*0.9*0.9*0.9*0.9*0.9*0.9*循环0.9等于?0 2020-06-06 …
将4名司机和8名售票员分配到四辆公共汽车上,每辆车上分别有1名司机和2名售票员,则有可能的分配方案 2020-07-15 …
△=0,△<0时一元二次方程ax2+bx+c=0(a>0)的根根需要用字母代表出来△>0,△=0,△ 2020-12-27 …
1.实验室需要配置500ml0.4mol/L的Na2CO3溶液,现用Na2CO3•10H2O需称取几 2021-02-01 …