2
나는이 스크립트를 postgres를 설치하는 모듈로 작성했다. 이것은 사용자가 데이터베이스가 만들어 졌음을 보여주고 데이터베이스가 보았는지에 대한 입력을 얻는다. 만들어진. 내가 스크립트를 실행하면, 나는 오류 나는 주위 예와 ''주위에 네 내가없는 것을 알아낼 수 없습니다 ","추가 시도line [: missing`] 'debugging help
./dbtest: line 39: [: missing `]'
를 얻을. 스크립트는 다음과 같습니다.
#
#
# 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
이 스크립트에는 무엇이 있습니까?
감사합니다.
그러나 'test' 자신의 논리 옵션을 사용할 수 있습니다. '[this = this-a that = that]' – ghoti
좋은 지적이며, 엄격한 대답이 그것을 포함했을 것이다. 그러나 필자와 (많은 [others others] (https://wiki.ubuntu.com/DashAsBinSh#A.5B))는 일반적으로'-a'와'-o'로 구분되는 것이 아니라 별도의 테스트로보기를 좋아합니다. 테스트가 더욱 복잡 해짐에 따라 그래도 좋은 캐치;) –