为shell脚本制作配置文件

时间:2012-02-14 08:50:25

标签: linux shell

如何为可执行shell脚本创建配置文件?

1 个答案:

答案 0 :(得分:3)

您的问题不明确,但通常shell脚本的配置文件只包含赋值:

$ cat config
FOO=foo-value
$ cat script
#!/bin/sh
test -r ${CONFIG:=/path/to/config} && . $CONFIG
echo The configged value of FOO is ${FOO?FOO is unassigned}
相关问题