llguo130 发表于 2013-1-28 14:02:08

shell 配合 conf文件

当前目录
/
 
文件
/test.sh
/conf
 
/test.sh
文件内容
-- #!/bin/sh
-- . conf
-- echo $x
-- echo $y
 
/conf
文件内容
-- x=1
-- y=2
 
说明:
conf为配置文件
test.sh为执行文件
test.sh中执行conf文件 即 . conf
. 即 source
. 与配置文件conf之间有空格
 
配置与执行文件分离,降低耦合
 
 
页: [1]
查看完整版本: shell 配合 conf文件