我想从中获取数字rating
作为输出
# nc localhost 9571
language:
language:en_ZA.UTF-8
language:en_ZW.UTF-8
session-with-name:Ubuntu Classic (No effects):gnome-session --session=2d-gnome
session-with-name:Ubuntu (Safe Mode):gnome-session -f --session=2d-gnome
session-with-name:Ubuntu Classic:gnome-session --session=classic-gnome
xsession:/etc/X11/Xsession
rating:94
我可以这样
# nc localhost 9571 | grep rating | cut -d: -f2
94
但是可以awk
用来代替一个更简单的解决方案吗?