if[-d /abmusr06/abm/u开发者_开发知识库sers/dywrk01/run_time];
then
echo "Pack installation Failed"
exit(1)
fi
This the above code fine?
Assuming this is Bourne Shell (/bin/sh):
if [ -d /abmusr06/abm/users/dywrk01/run_time ]
then
echo "Pack installation Failed"
exit 1
fi
- Put spaces around the brackets:
if [ -d
. Think of[
as a (key)word - it needs to stand by itself. You wouldn't sayls-l
, you sayls
(space)-l
. - Use
exit 1
, notexit(1)
. - The semicolons are unnecessary if everything is on separate lines.
- The above seems to work in Cygwin for me.
if [ -d "directory" ];then
....
fi
精彩评论