|

楼主 |
发表于 2005-8-3 16:47:20
|
显示全部楼层
比如文件123.conf是这样的:
[ftpserver]
[IP=61.172.249.102]
[port=21]
[user=1234]
[password=1234]
[/ftpserver]
那我修改其IP是不是应该这样写呢:
#!/bin/sh
echo -n "Enter new IP address: "
read IP
echo $ip |awk -F '.' '{ if ( ($1 >256 || $1 <0) || ($2 >256 || $2 < 0) || ($3 > 256 || $3 < 0) || ($
4 >256 || $4 < 0 )) print $0 ,"is incorrect"}'
sed "/IP=/ c\IP=$ip" ./123.conf
对吗? |
|