#!/bin/bash
NUM=1
while read ip port
do
echo -e "第$NUM个是$ip"
echo -e "第$NUM个$port"
NUM=$(( $NUM + 1 ))
done </root/sh/ip.txt
ip.txt的内容
10.1.1.10 3000
10.1.1.11 3001
10.1.1.12 3002
10.1.1.13 3003
#!/bin/bash
NUM=1
while read ip port
do
echo -e "第$NUM个是$ip"
echo -e "第$NUM个$port"
NUM=$(( $NUM + 1 ))
done </root/sh/ip.txt
ip.txt的内容
10.1.1.10 3000
10.1.1.11 3001
10.1.1.12 3002
10.1.1.13 3003