shell脚本读取配置文件
2012-08-21 17:23
573 查看
#!/bin/sh
pack_install()
{
echo "hello"
if [ $3 = "\"y\"" ];then
salt "$2" cmd.run "apt-get install --force-yes -y $1" 1>/dev/null 2>&1
fi
}
pack="elasticsearch"
var=$(awk -F '=' '/\[com1\]/{a=1}a==1&&$1~/key/{print $2;exit}' p.init)
echo $var
echo "ip"
read ip
pack_install $pack $ip $var
注:以上测试文件均在同级目录
pack_install()
{
echo "hello"
if [ $3 = "\"y\"" ];then
salt "$2" cmd.run "apt-get install --force-yes -y $1" 1>/dev/null 2>&1
fi
}
pack="elasticsearch"
var=$(awk -F '=' '/\[com1\]/{a=1}a==1&&$1~/key/{print $2;exit}' p.init)
echo $var
echo "ip"
read ip
pack_install $pack $ip $var
注:以上测试文件均在同级目录
相关文章推荐
- shell脚本按行读取配置文件并解析
- shell脚本读取ini配置文件的值
- shell脚本读取配置文件
- shell脚本读取ini配置文件的值
- Shell脚本读取ini配置文件的实现代码2例
- shell脚本读取ini配置文件的值
- Shell脚本读取ini配置文件的实现代码2例
- shell脚本读取ini配置文件的值
- 读取配置文件的shell脚本实现
- shell脚本读取ini配置文件的值
- shell脚本读取配置文件
- 如何用shell脚本读取配置文件
- Shell脚本——按行读取文件
- shell脚本获取配置文件中的内容
- unix下使用TCL脚本读取配置文件
- shell脚本:一次读取文件的一行,并输出
- shell脚本如何从json文件读取一个某个值
- 随机读取文件做算checksum shell 脚本
- shell启动时读取的配置文件
- Shell脚本实现批量生成nagios配置文件