#!/bin/bash
cd $(cd "$(dirname "$0")"; pwd)
SAVEIFS=$IFS
IFS=":"
while read office ip
do
echo "$ip"
eval $office=$ip
done < toalip.txt
IFS=$SAVEIFS
转载于:https://blog.51cto.com/junlinux/1290360
#!/bin/bash
cd $(cd "$(dirname "$0")"; pwd)
SAVEIFS=$IFS
IFS=":"
while read office ip
do
echo "$ip"
eval $office=$ip
done < toalip.txt
IFS=$SAVEIFS
转载于:https://blog.51cto.com/junlinux/1290360