我已经将此脚本编写为安装 postgres 的模块,这是为了向用户显示数据库已创建并获取他/她的输入,以便他们看到数据库已创建。当我运行脚本时,我得到了错误
./dbtest: line 39: [: missing `]'
我尝试在 yes 周围添加“”,在 yes 周围添加 '',但我无法弄清楚缺少什么。脚本如下
#
#
# Check to make sure the database was created and who is the owner
#
#
if [ -f showdb ];
then
cp showdb /home
else
echo " show database file is missing "
fi
if [ -f /home/showdb ];
then
su - postgres -c '/home/showdb'
echo " Do you see the data name created listed above? "
echo " "
echo " Type yes or no (type out the whole word please) "
echo " "
read dbawr
if [ $dbawr == yes && $dbawr == Yes ];
then
echo "Great!"
exit
else
echo " Please contact tech support "
pause " Press [CTRL] [Z] to exit the program now "
fi
else
echo " File Missing!!"
fi
我在这个脚本中缺少什么?
谢谢!