免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1120 | 回复: 1
打印 上一主题 下一主题

[文件目录] 请教,怎么通过一条命令查看多有FC卡的WWN号 [复制链接]

论坛徽章:
1
程序设计版块每日发帖之星
日期:2016-06-29 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2017-05-27 15:18 |只看该作者 |倒序浏览
假如我有四个HBA卡,对应的四个文件
/sys/class/fc_host/host1/port_name  
/sys/class/fc_host/host2/port_name  
/sys/class/fc_host/host13/port_name  
/sys/class/fc_host/host14/port_name  

我想通过一条命令,取出所有的wwn号(现在只能取出host1-host9之间的)
#awk '{print FILENAME,$0}' /sys/class/fc_host/host[1-9]/port_name
/sys/class/fc_host/host1/port_name 0x10000090faf43e4e
/sys/class/fc_host/host2/port_name 0x10000090faf43e4f
#awk '{print FILENAME,$0}' /sys/class/fc_host/host[0-9][0-9]/port_name
/sys/class/fc_host/host13/port_name 0x21000024ff7f780e
/sys/class/fc_host/host14/port_name 0x21000024ff7f780f

求教怎么修改这个/sys/class/fc_host/host[*******]/port_name路径,可以达到如下效果
#awk '{print FILENAME,$0}' /sys/class/fc_host/host[**********]/port_name
/sys/class/fc_host/host1/port_name 0x10000090faf43e4e
/sys/class/fc_host/host2/port_name 0x10000090faf43e4f
/sys/class/fc_host/host13/port_name 0x21000024ff7f780e
/sys/class/fc_host/host14/port_name 0x21000024ff7f780f


论坛徽章:
0
2 [报告]
发表于 2017-05-27 15:40 |只看该作者
/sys/class/fc_host/host*/port_name
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP