Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple conditions in an if statement 1

Status
Not open for further replies.

vergeb

MIS
Sep 22, 2003
8
US
Hello,
I am working on an aix korn shell script. In that script I've got an if statement that I want to have to conditions for: ie: if $color="blue" and $size=large; then.....

How do I do this?

 
Try something like this:
Code:
if [ "$color" = "blue" -a "$size" = "large" ]; then.....
Feel free to do a man ksh and a man test


Hope This Help
PH.
 
in ksh u can slo do
Code:
if [[ "$color" = "blue" && "$size" = "large" ]
then....
fi



[ponder]
----------------
ur feedback is a very welcome desire
 

sorry forgot the last bracket
if [[ "$color" = "blue" && "$size" = "large" ]]
then....
fi




[ponder]
----------------
ur feedback is a very welcome desire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top