Visit The New, Modern Unix Linux Community

Comparing two months

Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Comparing two months
# 1  
Comparing two months

Hi all,

Using shell script and awk statements, I manage to get the month and year of the Patch Bundle installed on the system. Now I have to compare month and year of Patch Bundle installed to the Patch Bundle which is desired on the workstation. I am able to do easily comparison of year but not of month. Can anyone suggest how to do this???

In short I have to accomplish:
if [ "march" greater than "november" ];
echo "jjjjjjjj"
echo "iiiiiiii"

Thanx for your cooperation and help
# 2  
Use a case statement to convert month to numeric form.

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #659
Difficulty: Medium
It is not possible to run DOS on Linux.
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Months difference between 2 dates

Hello, I would like to find out the number of months between two dates as below example. date 1 = 03-02-2016 date 2 = 15-11-2015 I need 04 as months difference. Any help on this is highly appreciated. Thanks, Keerti (3 Replies)
Discussion started by: keertis
3 Replies

2. Shell Programming and Scripting

Naming number to months

Hi, I have many files of monthly means from model simulation such as 1,2,3,4.....12, corresponding to jan, feb, mar,....., dec. e.g.,, ............., i want to write a shell script such that it should conveet number into months and year such as..... (4 Replies)
Discussion started by: mahesh shinde
4 Replies

3. Shell Programming and Scripting

How to get date n months before in Unix?

Hi, I need the date n months before currrent date I need to store date in a varible say x and then get the date 6 month before and get the result in the format 25-Aug-2009 Please Advice (7 Replies)
Discussion started by: mad_man12
7 Replies

4. Post Here to Contact Site Administrators and Moderators

All threads closed after 3 months

I routinely watch for threads that have been unanswered for some time. Recently a rule has been implemented to close threads older than 3 months, which is rather restrictive, because now the last few pages of the unanswered threads section cannot be replied upon, but more importantly eliminates the... (23 Replies)
Discussion started by: figaro
23 Replies

5. Shell Programming and Scripting

Delete 6 months old files

Hi, Iam trying to delete 6 months old files. Iam using the following script -ctime +190 -type f -exec echo rm {} \; Iam getting an error saying -ctime not found. (6 Replies)
Discussion started by: Sompalle Jalaja
6 Replies

6. Shell Programming and Scripting

calculate 13 months ago

hi, I have a big file that contains datas since 4 years ago. I need re-create this file but just lines that are 13 months ago from today. see what I have: ( I have a file.ksh that calls this file.scl ok !!) ======== file.scl ================ /STATISTICS=stderr /STABLE /NODUPLICATES... (3 Replies)
Discussion started by: andrea_mussap
3 Replies

7. UNIX for Advanced & Expert Users

Subtract 2 months from the date

I have the script which appends month and year to the name of the file. Now every time when I append the month-year combination I have to subtract 2 months from the current date and then append it, since we are sending our vendor 2 months prior worth of data eveytime. #! /usr/bin/ksh ... (5 Replies)
Discussion started by: mahekr2000
5 Replies

8. Shell Programming and Scripting

some months ego

Hi, how can I format date function to find n (n=1 to 11) months ego ? For exemple now we are in july and I want to have a variable presenting april. How should it be : month=`date +%b`????? Many thanks before. (8 Replies)
Discussion started by: big123456
8 Replies

9. IP Networking

DNS Help - Been trying to do this for months

Ok someone has to be able to help me here. I have the latest webmin, and i have bind i have a domain name called i have one server, just one as im poor so the one server is gunna be the dns, email, web and ftp server. Its only for a small site anyway so it will... (16 Replies)
Discussion started by: matt2kjones
16 Replies

Featured Tech Videos