#!/bin/bash
ip=(`for x in {1..26};do echo $x ;done`)
domain=(`for y in {a..z};do echo $y ;done`)
for i in `seq 0 25`
do
echo "192.168.8.${ip[i]} www.${domain[i]}.com " >> /etc/hosts
done
批量主机名
于 2023-04-05 20:38:04 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
#!/bin/bash
ip=(`for x in {1..26};do echo $x ;done`)
domain=(`for y in {a..z};do echo $y ;done`)
for i in `seq 0 25`
do
echo "192.168.8.${ip[i]} www.${domain[i]}.com " >> /etc/hosts
done