- 论坛徽章:
- 0
|
本帖最后由 sdydding 于 2011-10-12 16:23 编辑
脚本如下:- startmode="$(cat ${cfg_file} |grep startmode|cut -d "=" -f 2)"
- up_times=`cat ${cfg_file} |grep up_times|cut -d "=" -f 2`
- echo ${startmode}
- echo "up_times="${up_times}
- if [ $startmode = "1" ]; then
- echo "1"
- exit 1;
- elif [ "$startmode" = "2" ] && [ "$up_times" != "2" ]; then
- echo "2"
- exit 1;
- elif [ "$startmode" = "2" ] && [ "$up_times" = "3" ]; then
- echo "3"
- exit 1;
- fi
复制代码 startmode我直接赋值为1可以进入echo "1"
但是我取配置文件中的值也是1,怎么就进入不了echo "1"?
配置文件如下:
[update]
startmode=1
up_times=1
control_code=1
frequency=474000000
modulation=6
symbolRate=6875
service_id=5 |
|