我有文件的上下文如下:
CA Services Status Report
Component Name Pid Status
------------------------------------ ------- --------------
WAAE Web Server (ASD) 20841 running
WAAE Application Server (ASD) 20281 running
WAAE Scheduler (ASD) 20486 running
WAAE Agent (WA_AGENT) 20109 running
CA-wcc-services Server 22385 running
CA-wcc Server 24410 running
Run Code Online (Sandbox Code Playgroud)
我只想在屏幕上打印Pid。
我尝试使用awk和grep,但无法打印Pid。
cat test | awk '{print $5}'
Run Code Online (Sandbox Code Playgroud)
我只想打印“ Pid”列,但无法完全打印它。