Capture of month


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Capture of month
# 1  
Old 01-10-2008
Capture of month

Guys I need your help...

I receive the month and the day in a file and I keep it in a variable. I need to take this day that Iīve kept compare with the current day and pick the file to the next day...
Letīs say I receive a file 27-JUL-2007 and I need to check in the system the current day and pick the next day. Letīs say that the current day is 27-JUL-2007 so I need to pick the files from 28-JUL-2007. The problem is how to do it in a very quick and clean way... Another problem what will I do when I receive a MONTH END file like 31-JAN-2008 or 29-FEV-2008... How can I capture the date in the system? Thereīs only the cal statment?

Thank you - Regards
# 2  
Old 01-10-2008
if you have GNU date
Code:
# date +%Y%m%d -d "1 day"

# 3  
Old 01-10-2008
Thkx Mr... Iīll try
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need last month files after 10th of every month

Hi, I need all file names in a folder which has date >= 10th of last month, Example : files in folder AUTO_F1_20140610.TXT BUTO_F1_20140616.TXT CUTO_F1_20140603.TXT FA_AUTO_06012014.TXT LA_AUTO_06112014.TXT MA_AUTO_06212014.TXT ZA_AUTO_06232014.TXT Output: AUTO_F1_20140610.TXT... (9 Replies)
Discussion started by: nani1984
9 Replies

2. Shell Programming and Scripting

How to add decimal month to some month in sql, php, perl, bash, sh?

Hello, i`m looking for some way to add to some date an partial number of months, for example to 2015y 02m 27d + 2,54m i need to write this script in php or bash or sh or mysql or perl in normal time o unix time i`m asking or there are any simple way to add partial number of month to some... (14 Replies)
Discussion started by: bacarrdy
14 Replies

3. Shell Programming and Scripting

Convert From Month Number to Month Name

Hi, I have a script that accepts an input date from the user in yyyy-mm-dd format. I need to get the mm-dd part and convert it to month name. example: 2011-11-15 I want that to become "Nov 15" I don't have the GNU date, I am using an AIX os. Thanks. (1 Reply)
Discussion started by: erin00
1 Replies

4. Shell Programming and Scripting

Help with getting last date of previous month and first date of previous 4th month from current date

I have requirment to get last date of previous month and the first date of previous 4th month: Example: Current date: 20130320 (yyyymmdd) Last date of previous month: 20130228 (yyyymmdd) First date of previous 4th month: 20121101 (yyyymmdd) In my shell --date, -d, -v switches are not... (3 Replies)
Discussion started by: machomaddy
3 Replies

5. Shell Programming and Scripting

Script to counting a specific word in a logfile on each day of this month, last month etc

Hello All, I am trying to come up with a shell script to count a specific word in a logfile on each day of this month, last month and the month before. I need to produce this report and email it to customer. Any ideas would be appreciated! (5 Replies)
Discussion started by: pnara2
5 Replies

6. UNIX for Dummies Questions & Answers

print previous month (current month minus 1) with Solaris date and ksh

Hi folks month=`date +%m`gives current month Howto print previous month (current month minus 1) with Solaris date and ksh (7 Replies)
Discussion started by: slashdotweenie
7 Replies

7. Shell Programming and Scripting

Convert into month name

Hi, If I am having month like 2/3/4 then how can I convert it into month name like Feb/Mar/Apr.... Is there any defined function in Perl ?? (2 Replies)
Discussion started by: darshakraut
2 Replies

8. Shell Programming and Scripting

Month name

Hi, Could you pls help me out in finding the name of next month.? For eg: date +"%b" gives the current month ie 'Jul' I want to get the output as 'Aug' Thanks, Jerry (4 Replies)
Discussion started by: jerrynimrod
4 Replies

9. Shell Programming and Scripting

last day of the month

can any one please tell me how can I get the last day of the month Thanks (4 Replies)
Discussion started by: aya_r
4 Replies

10. Shell Programming and Scripting

month value in number

Please I have another question related to month I couldn't find it between FAQ area, the question is can we get the value for month in letters , what I mean if I have the month = Jun can I get it in number like month = 6 ..is there any function do that directly ?? Thanks (1 Reply)
Discussion started by: aya_r
1 Replies
Login or Register to Ask a Question