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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ksh - test if string contains alphanumeric... tugger Shell Programming and Scripting 3 10-16-2007 05:23 AM
With Regex Spliting the string into Alphanumeric and Numeric part ozgurgul Shell Programming and Scripting 1 06-30-2007 10:52 AM
AlphaNumeric String Operations lakshmikanth UNIX for Dummies Questions & Answers 3 01-05-2007 06:55 AM
sort command - alphanumeric gefa Shell Programming and Scripting 4 08-30-2006 11:36 AM
matching alphanumeric string sskb Shell Programming and Scripting 4 12-12-2001 10:48 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-25-2007
rakeshou rakeshou is offline
Registered User
  
 

Join Date: May 2007
Posts: 75
alphanumeric comparision

I have a requirement where I need to check if

Quote:
r1v07l08ab < r1v07l09ak

r1v07l09ab < r1v07l09ac

r1v07l09ab < r1v07l09if
where r1v07l09ab is a software release.

I should always check for this to be true to continue the release deployment because an older release should not be deployed by mistake. I mean only the release greater than the current release should be deployed on the server.

please help.

Thanks in advance.

Thanks,
  #2 (permalink)  
Old 09-25-2007
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,557

Code:
awk 'BEGIN{ 
    if ("r1v07l09ab" < "r1v07l09ac" ) print "yup"
    else print "nope"
}'

  #3 (permalink)  
Old 09-25-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
rakeshou, would release "r2v12" be lower or higher than "r12v2"?
  #4 (permalink)  
Old 09-27-2007
rakeshou rakeshou is offline
Registered User
  
 

Join Date: May 2007
Posts: 75
Cool Pass Shell variables and return the response back to shell

this way I can pass SHELL Variables $prevRelease and $curRelease and also return the result back to SHELL


Code:
prevRelease=r1v07l09ab
currRelease=r1v07l09ac
VALID=`echo "$prevRelease $currRelease" | awk '{ if($1 < $2) print "1"; else print "0" }'`

Thanks ghostdog74 and porter for your responses
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0