#!/bin/bash for ip in `cat a.txt`;do a=`echo $ip|awk -F '.' '{print $1}'` b=`echo $ip|awk -F '.' '{print $2}'` c=`echo $ip|awk -F '.' '{print $3}'` d=`echo $ip|awk -F '.' '{print $4}'` e=$[`echo $c`+100] echo $a.$b.$e.$d done #注释: 因管理网ip原因,需要统计ip列表,目标是在ip地址第三位增加 100,列出ip