The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-02-2007
hcclnoodles hcclnoodles is offline
Registered User
  
 

Join Date: Mar 2002
Posts: 272
IF statement question

Hi there

We have boxes named server-sybase2, server-oracle1, etc etc

Does any body know how I can construct an if statement to say, if the hostname of the box contains the string "sybase" then do X ie



Code:
if [ `hostname` contains the string "sybase"]
then

X
fi

any help would be greatly appreciated