# 写日志函数
function write_log()
{now_time='['$(date +"%Y-%m-%d %H:%M:%S")']'
echo ${now_time} $1 | tee -a ${log_file}
}
write_log '####################################################'
write_log 'Install started' 'The log is writed to '${log_file}
write_log '####################################################'
#去空格函数
function trim()
{
echo "$1" | grep -o "[^ ]\+\( \+[^ ]\+\)*"
}
#取参数函数
function get_parameter()
{
local key="$1"
local file_name="$2"
local value=
local line_num=
line_num=`awk -F"=" '$1 ~ "'$key'" {print $2}' $file_name | wc -l`
value=`awk -F"=" '$1 ~ "'$key'" {print $2}' $file_name`
value=`trim $value`
echo count=$line_num
echo key=$key
echo value=$value
}