Even though this is not the best way, I was still proud of myself for coming up with this one liner (execute from /sys/class/scsi_host)
for i in 0 1 2 3 4 5; do cat host$i/device/fc_host/host$i/port_name; done
Sample output:
[root@centos63node01 scsi_host]# for i in 0 1 2 3 4 5; do cat host$i/device/fc_host/host$i/port_name; done cat: host0/device/fc_host/host0/port_name: No such file or directory cat: host1/device/fc_host/host1/port_name: No such file or directory cat: host2/device/fc_host/host2/port_name: No such file or directory cat: host3/device/fc_host/host3/port_name: No such file or directory 0x5001438003af1ffc 0x5001438003af1b9e [root@centos63node01 scsi_host]#
Even though this is not the best way, I was still proud of myself for coming up with this one liner (execute from /sys/class/scsi_host)
ReplyDeletefor i in 0 1 2 3 4 5; do cat host$i/device/fc_host/host$i/port_name; done
Sample output:
[root@centos63node01 scsi_host]# for i in 0 1 2 3 4 5; do cat host$i/device/fc_host/host$i/port_name; done
cat: host0/device/fc_host/host0/port_name: No such file or directory
cat: host1/device/fc_host/host1/port_name: No such file or directory
cat: host2/device/fc_host/host2/port_name: No such file or directory
cat: host3/device/fc_host/host3/port_name: No such file or directory
0x5001438003af1ffc
0x5001438003af1b9e
[root@centos63node01 scsi_host]#