The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-11-2005
Registered User
 

Join Date: Jul 2005
Posts: 35
How to compaer

HI all ,

I Have two variables with 2 value

a='software'
b='hardware'

i have to compare these values ..

how to do i dnt hav any idea..

I m a beginner .. pls help me out
Reply With Quote
Forum Sponsor
  #2  
Old 07-11-2005
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,699
Code:
#! /bin/sh

a='software'
b='hardware'

if [ "$a" = "$b" ] ; then
echo " $a and $b are equal"
else
echo " $a and $b are not equal"
fi ;
Vino
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:54 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0