grep - selecting different values from two lines from output in shell -
I am using the runmqsc command to get the output as the following. But something I should be fired out I am using egrep and cut, but not getting the required result.
Runmqsc command: echo "dis clusqmgr (*) suspended" | runmqsc QMGR1
Original output:
1: dis clusqmgr (*) Suspended AMQ8441: Performance Cluster Queue Manager Details. CUSUmMGR (GWD1) Channel (TGBD1 SSL) Cluster (CUSD) Suspended (NE) AMQ 8441: Cluster Content Details Details Details CUSUMMGR (GWD2) Channel (TZW 2.SLL) Cluster (CUSD) Suspended ( No) desired output:
CUSUmMGR (GWD1) suspended Command to get it Using:
echo " Dis clusqmgr (*) suspended "| Runmqsc qmgr1 For example 'CULUMMGR | Suspended '| tr ')' '\ n' | Grep "CLUSQMGR (" | cut-2 2-d ")" Please help.
One way to pipe your output:
For 'CLUSQMGR | Suspend '| Paste - - | For example, for example 'CLUSQMGR | SUSPEND 'filename | 'Awk' {print $ 1, $ 4} '' Paste - - | The original input is posted by you '{print $ 1, $ 4}' where filename is: CUSUmMGR (GWD1) Suspended (CO) CUSUmMGR (GWD2) Suspended (A)
An Option Pipe on Command Output Will:
such as -Pro-O 'B (CULUMMR | suspended) \ S +' | Paste - -
Comments
Post a Comment