- 论坛徽章:
- 0
|
没有/bin/bash
改了能运行但计算出错- root@IPHONE5S:/tmp# sh qq
- seq: invalid option -- f
- 0.0.0.192.168
- BusyBox v1.19.4 (2013-12-19 16:15:55 CST) multi-call binary.
- Usage: seq [-w] [-s SEP] [FIRST [INC]] LAST
- Print numbers from FIRST to LAST, in steps of INC.
- FIRST, INC default to 1.
- -w Pad to last with leading zeros
- -s SEP String separator
- root@IPHONE5S:/tmp# cat /tmp/qq
- #!/bin/bash
- #▒▒▒▒ֹIP▒▒ַתΪ▒▒▒▒▒֣▒
- star=`echo "${LINE%%-*}" |awk -F. '{printf "%.f",$1*256^3+$2*256^2+$3*256+$4}' `
- end=`echo "${LINE##*-}" |awk -F. '{printf "%.f",$1*256^3+$2*256^2+$3*256+$4}'`
- #▒▒▒▒▒▒IP֮▒▒▒▒▒е▒ַ
- seq -f "%.f" $star $end |awk '{i=$0;print int(i/256^3),int(i%256^3/256^2),int(i%256^3%256^2/256),i%256^3%256^2%256}' OFS=. < /tmp/ip.txt
- root@IPHONE5S:/tmp# cat /tmp/ip.txt
- 192.168.1.2-192.168.10.5
复制代码 回复 7# 关阴月飞
|
|