#!/bin/bash
mask2cdr ()
{
# Assumes there's no "255." after a non-255 byte in the mask
local x=${
1##*255.}
set -- 0^^^128^192^224^240^248^252^254^ $(( (${#1} - ${#x})*2 )) ${x%%.*}
x
shell实现netmask掩码和cidr掩码位转换
最新推荐文章于 2024-03-08 22:25:46 发布