高分虚心求教编辑一个脚本,使用sed提取指定行中匹配的内容,并按照指定格式输出文本.[root@server1 ]# vim /tmp/test.txt Trying 192.168.0.7...^MConnected to 192.168.0.7.^MEscape character is '^]'.^M1、首先提取从.这

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/04 02:39:05
高分虚心求教编辑一个脚本,使用sed提取指定行中匹配的内容,并按照指定格式输出文本.[root@server1 ]# vim /tmp/test.txt Trying 192.168.0.7...^MConnected to 192.168.0.7.^MEscape character is '^]'.^M1、首先提取从.这

高分虚心求教编辑一个脚本,使用sed提取指定行中匹配的内容,并按照指定格式输出文本.[root@server1 ]# vim /tmp/test.txt Trying 192.168.0.7...^MConnected to 192.168.0.7.^MEscape character is '^]'.^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文本中.

高分虚心求教编辑一个脚本,使用sed提取指定行中匹配的内容,并按照指定格式输出文本.[root@server1 ]# vim /tmp/test.txt Trying 192.168.0.7...^MConnected to 192.168.0.7.^MEscape character is '^]'.^M1、首先提取从.这
grep -oP '((user online|login|player count|memory used|free|total)="([0-9]*)")' test.txt > mail.txt