shell脚本读取配置文件

#!/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

 

注:以上测试文件均在同级目录

你可能感兴趣的:(shell,测试,脚本)