My input looks like the following:
I want the output to be
/dev/rmt/c56t0d0BESTnb MXP0903BDE
/dev/rmt/c57t0d0BESTnb HU10904G41
Here is what I'm doing:
Can you suggest a way to shorten it?
Code:
Device Name : "/dev/rmt/c56t0d0BESTnb"
Passthru Name: "/dev/sctl/c56t0l0"
Volume Header: ""
Port: -1; Bus: -1; Target: -1; LUN: -1
Inquiry : "HP Ultrium 3-SCSI M66S"
Vendor ID : "HP "
Product ID : "Ultrium 3-SCSI "
Product Rev: "M66S"
Serial Number: "MXP0903BDE"
WWN : ""
WWN Id Type : 0
Device Identifier: ""
Device Type : SDT_TAPE
NetBackup Drive Type: 16
Removable : Yes
Device Supports: SCSI-3
Flags : 0x0
Reason: 0x0
------------------------------------------------------------
Device Name : "/dev/rmt/c57t0d0BESTnb"
Passthru Name: "/dev/sctl/c57t0l0"
Volume Header: ""
Port: -1; Bus: -1; Target: -1; LUN: -1
Inquiry : "HP Ultrium 3-SCSI M66S"
Vendor ID : "HP "
Product ID : "Ultrium 3-SCSI "
Product Rev: "M66S"
Serial Number: "HU10904G41"
WWN : ""
WWN Id Type : 0
Device Identifier: ""
Device Type : SDT_TAPE
NetBackup Drive Type: 16
Removable : Yes
Device Supports: SCSI-3
Flags : 0x0
Reason: 0x0
I want the output to be
/dev/rmt/c56t0d0BESTnb MXP0903BDE
/dev/rmt/c57t0d0BESTnb HU10904G41
Here is what I'm doing:
Code:
awk '/Device Name/ || /Serial Number/ {print $NF}' | sed 's/"//g' | awk '/dev/ {print d;d=""};{d=d" "$0}END{print d}'
Can you suggest a way to shorten it?