时间:2020-10-15 23:16:25 | 栏目:Shell | 点击:次
ini DEMO
host=127.0.0.1
name=my
pass=mylove
type=ftp
[TESTSSH]
host=127.0.0.1
name=my
pass=mylove
type=ssh
[END]
cat $CONF \\
| grep -v ^$ \\
| sed -n "s/\\s\\+//;/\\[${HOSTID}\\]/,/^\\[/p" \\
| grep -v ^'\\['
echo "----INFO----"
INFO=`cat $CONF \\
| grep -v ^$ \\
| sed -n "s/\\s\\+//;/\\[${HOSTID}\\]/,/^\\[/p" \\
| grep -v ^'\\[' ` && eval "$INFO"
echo $host
echo $name
echo $pass
echo $type
}