#!/bin/bash
function addsep()
{
echo $1|awk 'BEGIN{FS="";ORS=""}{for(x=1;x<=NF;x++){if(x%2==0)print $x":";if(x%2==1)print $x}print"\n"}'|sed 's/:$//g'
}
echo 1152922127287633521|while read wwn
do
wwn1=`printf "%x\n" $wwn` #10进制转换成16进制
wwn2=`addsep $wwn1` #将字符串转换成:分隔格式
echo $wwn2
done
阅读(1751) | 评论(0) | 转发(0) |