How can I print everything below after a trailing ===========
switchName: GBL_A_SW1
switchType: 166.0
switchState: Online
switchMode: Native
switchRole: Principal
switchDomain: 42
switchId: fffb3a
switchWwn: 10:00:97:55:21:11:b7:c4
zoning: ON (GBL_Fabric_A_Active)
switchBeacon: OFF
FC Router: OFF
HIF Mode: OFF
Allow XISL Use: OFF
LS Attributes: [FID: 128, Base Switch: No, Default Switch: Yes, Ficon Switch: No, Address Mode 0]
Index Slot Port Address Media Speed State Proto
============================================================
0 3 0 2a0040 id N8 Online FC E-Port (Trunk port, master is Slot 3 Port 1 )
1 3 1 2a0140 id N8 Online FC E-Port 10:00:c4:f5:7c:2c:1d:d8 "GBL_A_BAS384B" (downstream)(Trunk master)
2 3 2 2a0240 id N8 Online FC F-Port 1 N Port + 1 NPIV public
3 3 3 2a0340 id N4 Online FC F-Port 20:00:00:05:1e:0f:39:f3
4 3 4 2a0440 id N8 Online FC F-Port 20:0f:00:05:33:46:0d:90
5 3 5 2a0540 id N16 Online FC F-Port 20:21:00:02:ac:01:ea:1d
6 3 6 2a0640 id N16 Online FC E-Port 5c:4f:57:c4:33:15:ce:20 "fcr_fd_160" (downstream)(Trunk master)
7 3 7 2a0740 id N16 Online FC E-Port (Trunk port, master is Slot 3 Port 6 )
8 3 8 2a0840 id N8 Online FC F-Port 50:01:73:80:31:2d:01:80
9 3 9 2a0940 id N8 Online FC F-Port 50:05:07:63:05:23:12:d1
10 3 10 2a0a40 id N8 Online FC F-Port 50:05:07:68:01:50:ef:47
11 3 11 2a0b40 id N16 Online FC F-Port 20:21:00:02:ac:01:c0:55
12 3 12 2a0c40 id N8 Online FC F-Port 10:00:8c:7c:ff:21:ab:12
13 3 13 2a0d40 id N8 Online FC F-Port 1 N Port + 3 NPIV public
14 3 14 2a0e40 id N4 Online FC F-Port 21:00:00:24:ff:25:f0:1e
15 3 15 2a0f40 id N16 Online FC F-Port 50:05:07:68:01:40:a7:28
128 3 16 2a8040 id N8 Online FC F-Port 21:00:00:24:ff:4e:76:ad
129 3 17 2a8140 id N8 Online FC F-Port 50:05:07:68:01:20:d6:f0
130 3 18 2a8240 id N4 Online FC F-Port 20:00:00:05:1e:0f:e1:d0
Like this
0 3 0 2a0040 id N8 Online FC E-Port (Trunk port, master is Slot 3 Port 1 )
1 3 1 2a0140 id N8 Online FC E-Port 10:00:c4:f5:7c:2c:1d:d8 "GBL_A_BAS384B" (downstream)(Trunk master)
2 3 2 2a0240 id N8 Online FC F-Port 1 N Port + 1 NPIV public
3 3 3 2a0340 id N4 Online FC F-Port 20:00:00:05:1e:0f:39:f3
4 3 4 2a0440 id N8 Online FC F-Port 20:0f:00:05:33:46:0d:90
5 3 5 2a0540 id N16 Online FC F-Port 20:21:00:02:ac:01:ea:1d
6 3 6 2a0640 id N16 Online FC E-Port 5c:4f:57:c4:33:15:ce:20 "fcr_fd_160" (downstream)(Trunk master)
7 3 7 2a0740 id N16 Online FC E-Port (Trunk port, master is Slot 3 Port 6 )
8 3 8 2a0840 id N8 Online FC F-Port 50:01:73:80:31:2d:01:80
9 3 9 2a0940 id N8 Online FC F-Port 50:05:07:63:05:23:12:d1
10 3 10 2a0a40 id N8 Online FC F-Port 50:05:07:68:01:50:ef:47
11 3 11 2a0b40 id N16 Online FC F-Port 20:21:00:02:ac:01:c0:55
12 3 12 2a0c40 id N8 Online FC F-Port 10:00:8c:7c:ff:21:ab:12
13 3 13 2a0d40 id N8 Online FC F-Port 1 N Port + 3 NPIV public
14 3 14 2a0e40 id N4 Online FC F-Port 21:00:00:24:ff:25:f0:1e
15 3 15 2a0f40 id N16 Online FC F-Port 50:05:07:68:01:40:a7:28
128 3 16 2a8040 id N8 Online FC F-Port 21:00:00:24:ff:4e:76:ad
129 3 17 2a8140 id N8 Online FC F-Port 50:05:07:68:01:20:d6:f0
130 3 18 2a8240 id N4 Online FC F-Port 20:00:00:05:1e:0f:e1:d0
Tried using awk '{print $0}' RS='==' data
but details above ========
is still there and with a big gap.
Update:
So everything is now in place. However, i'm having a hard time concatenating the file.
I have two files named sw_name
and final_sw_name
which consist of the data above and is being passed on to a variable.
When I tried to echoed it using this command
echo -e "$sw_name" > ${SW_TEMP}/TP; echo -e "\n final_sw_name >> ${SW_TEMP}/TP
The $sw_name
is being echoed on the file but not $final_sw_name
.
Should be like this:
Switch_Name
0 3 0 2a0040 id N8 Online FC E-Port (Trunk port, master is Slot 3 Port 1 )
1 3 1 2a0140 id N8 Online FC E-Port 10:00:c4:f5:7c:2c:1d:d8 "GBL_A_BAS384B" (downstream)(Trunk master)
2 3 2 2a0240 id N8 Online FC F-Port 1 N Port + 1 NPIV public
3 3 3 2a0340 id N4 Online FC F-Port 20:00:00:05:1e:0f:39:f3
4 3 4 2a0440 id N8 Online FC F-Port 20:0f:00:05:33:46:0d:90
5 3 5 2a0540 id N16 Online FC F-Port 20:21:00:02:ac:01:ea:1d
6 3 6 2a0640 id N16 Online FC E-Port 5c:4f:57:c4:33:15:ce:20 "fcr_fd_160" (downstream)(Trunk master)
7 3 7 2a0740 id N16 Online FC E-Port (Trunk port, master is Slot 3 Port 6 )
8 3 8 2a0840 id N8 Online FC F-Port 50:01:73:80:31:2d:01:80
9 3 9 2a0940 id N8 Online FC F-Port 50:05:07:63:05:23:12:d1
10 3 10 2a0a40 id N8 Online FC F-Port 50:05:07:68:01:50:ef:47
11 3 11 2a0b40 id N16 Online FC F-Port 20:21:00:02:ac:01:c0:55
12 3 12 2a0c40 id N8 Online FC F-Port 10:00:8c:7c:ff:21:ab:12
13 3 13 2a0d40 id N8 Online FC F-Port 1 N Port + 3 NPIV public
14 3 14 2a0e40 id N4 Online FC F-Port 21:00:00:24:ff:25:f0:1e
15 3 15 2a0f40 id N16 Online FC F-Port 50:05:07:68:01:40:a7:28
128 3 16 2a8040 id N8 Online FC F-Port 21:00:00:24:ff:4e:76:ad
129 3 17 2a8140 id N8 Online FC F-Port 50:05:07:68:01:20:d6:f0
130 3 18 2a8240 id N4 Online FC F-Port 20:00:00:05:1e:0f:e1:d0