- 论坛徽章:
- 0
|
本帖最后由 rabbitkn 于 2013-09-23 17:46 编辑
custom.conf 为配置文件,内容可能如下:
#HostName = devicename
#Model = device model
dm.Manufacturer= M1
dm.Model = MP2
bluetooth.Host= test
bluetooth.HostName = 877A
#说明,配置文件中字段=号前后可能没有空格,可能有一个或多个空格;
脚本中处理test.sh:
#!/bin/bash
function config_get() {
}
config_get "custom.conf" "dm.Manufacturer" "BT_MAN"
echo "$BT_MAN"
config_get "custom.conf" "dm.Model" "BT_MODEL"
echo "$BT_MODEL"
config_get "custom.conf" "bluetooth.Host" "BT_HOST"
echo "$BT_HOST"
config_get "custom.conf" "bluetooth.HostName" "BT_HOSTNAME"
echo "$BT_HOSTNAME"
#test.sh end
|
|