开发者

BCM Bladelogic Conditional statements in NSH

I am having trouble writing a simple if statement in a BMC Bladelogic NSH shell script.

My question is what is the 开发者_运维问答proper syntax to write a statement that compares two strings to see if they are equal or not. I understand how an if statement works the problem seems to be syntax.

An example of what I have tried is as follows where $PLATFORM is a string represintation of the server such as "aix" and $AIX is "aix"

if [ $PLATFORM == $AIX ];then 
 #do stuff
else
 #do other stuff
fi

This is a very specific question for if you deal with BMC Bladelogic NSH


Actually I feel foolish the answer is actually as such:

if [ $PLATFORM = $AIX ];then  
 #do stuff 
else 
 #do other stuff 
fi 

I knew it would be something very simple.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜