![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| comparing 2 strings | satish@123 | Shell Programming and Scripting | 2 | 05-16-2008 04:59 AM |
| comparing strings | agarwal | Shell Programming and Scripting | 3 | 04-16-2008 02:29 AM |
| Urgent:Comparing two Strings using If Loop | Anji | Shell Programming and Scripting | 2 | 01-09-2008 05:54 AM |
| Comparing Two Strings | Anji | Shell Programming and Scripting | 8 | 01-09-2008 03:32 AM |
| comparing two strings | ragha81 | Shell Programming and Scripting | 24 | 09-21-2006 08:52 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Comparing strings
I have two strings
a=Mar22 b=may21 how can I compare them Is this fine if[ $a -eq $b ] then; . ... else .... fi or if[ $a = $b ] then |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
for string comparisions we generally use = operator.
-eq is used for integer comparisons. if [ "str1" = "str2" ] then fi will do your task . |
|
#3
|
|||
|
|||
|
Many Thanks.It worked now. I tried with out " ".
|
|||
| Google The UNIX and Linux Forums |