这是我的代码的一部分:
FCWWN=`fcinfo hba 端口 | grep HBA | awk '{打印 $4}'` 对于我在 ${FCWWN} 做 FCREMOTE=`fcinfo 远程端口-p ${i} | grep 远程 | 瑙克'{打印 $4}'` PRODUCT=`/usr/sbin/luxadm 显示 ${FCREMOTE} | grep 产品 | nawk -F: '{打印 $2}'` CAPACITY=`/usr/sbin/luxadm 显示 ${FCREMOTE} | grep 容量 | nawk -F: '{打印 $2}'` LUNNAME=`/usr/sbin/luxadm 显示 ${FCREMOTE} | grep /dev/rdsk | grep -i -v 设备` FCSTATE=`fcinfo hba 端口 ${i} | grep 状态:| 瑙克'{打印 $2}'` 回声“” echo -e FC 端口 WWN "\033[1m \E[36;40m ${i} \033[0m 是 \033[1m \E[37;42m ${FCSTATE} \033[0m”; 回声 -ne "\E[0m" printf "############################################### ##################################\n" printf "%-6s %9s %18s \n" "LUN:" "存储" "磁盘" printf "%-6s %9s %18s \n" " " "类型" "大小" printf "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n" printf "%-6s\n %9s\n %2s\n" "${LUNNAME}" "${PRODUCT}" "${CAPACITY}" 完毕
输出是:
FC端口WWN 10000000c9822976在线 ################################################# ################################ LUN:存储磁盘 类型 尺寸 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- /dev/rdsk/c4t60060E80102A8AF005119C37000000C2d0s2 /dev/rdsk/c4t60060E80102A8AF005119C37000000C0d0s2 /dev/rdsk/c4t60060E80102A8AF005119C370000016Cd0s2 /dev/rdsk/c4t60060E80102A8AF005119C3700000028d0s2 /dev/rdsk/c4t60060E80102A8AF005119C37000000E1d0s2 DF600F DF600F DF600F DF600F DF600F 131072.000 兆字节 131072.000 兆字节 65536.000 兆字节 262144.000 兆字节 65536.000 兆字节
所需的输出是:
FC端口WWN 10000000c9822976在线 ################################################# ################################ LUN:存储磁盘 类型 尺寸 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- /dev/rdsk/c4t60060E80102A8AF005119C37000000C2d0s2 DF600F 131072.000 MB /dev/rdsk/c4t60060E80102A8AF005119C37000000C0d0s2 DF600F 131072.000 MB /dev/rdsk/c4t60060E80102A8AF005119C370000016Cd0s2 DF600F 65536.000 MB /dev/rdsk/c4t60060E80102A8AF005119C3700000028d0s2 DF600F 262144.000 MB /dev/rdsk/c4t60060E80102A8AF005119C37000000E1d0s2 DF600F 65536.000 MB
任何帮助将不胜感激。