我有以下格式的 mac 地址列表:
412010000018
412010000026
412010000034
我想要这个输出:
41:20:10:00:00:18
41:20:10:00:00:26
41:20:10:00:00:34
我试过这个,但没有用:
sed 's/([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/\1:\2:\3:\4/g' mac_list
我该怎么做?
最佳答案
这可能对你有用(GNU sed):
sed 's/..\B/&:/g' file
关于regex - sed 在 mac 地址中插入冒号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10991771/