9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have requirment to get last date of previous month and the first date of previous 4th month:
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
2. UNIX for Dummies Questions & Answers
I am using the below code to get the year and month from date:
Below gives output like 201212.
how do i get the previous month value(ie: subtract 1 from date)
Please help. :confused: (3 Replies)
Discussion started by: abhi_123
3. Shell Programming and Scripting
Hi all. I am scripting in a POSIX shell on HPUX.
I am running a script that needs to determine the number of days in a month.
I found this on the forum and it works great:
X=`cal $(date +%m) $(date +%Y) | grep -v '' | wc -w`
The issue is that I am running the script on the 7th day of... (11 Replies)
Discussion started by: lyoncc
4. UNIX for Dummies Questions & Answers
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
5. Shell Programming and Scripting
Can someone help me creating a function which will give me previous months.
like for example if the date is 200902 and if i call my function and pass a parameter 2 i want to get 200812 as the answer.
or if i pass 200902 with a parameter 7 then my function should give me the date as 200807. (1 Reply)
Discussion started by: Lincy
6. UNIX for Dummies Questions & Answers
I'm new to shell scripting.
We've develop a script which will grep a file on the search criteria, MON (Jan/Feb/Mar/etc). But we should set this sript in cron which will run on every first day of the month. The problem I'm having is, when I run the script, it is displaying the contents of... (7 Replies)
Discussion started by: suneelj
7. Shell Programming and Scripting
Hi, I'm new with Unix, I'm trying to get a last day of previous month with this format: %b %d %Y (example: Feb 25 2008).
Here is what I have so far.
# Check to see if this is January
... (11 Replies)
Discussion started by: sirrtuan
8. Shell Programming and Scripting
My task to to delete files which are of previous months.
I have files named as follows *CCYYMMDD.xls. on a particular day i have delete previous months files
i.e in Dec i have delete all nov files which look like 200511DD.XLS
in Jan i have to delete all Dec files 200512DD.xls
... (7 Replies)
Discussion started by: savitha
9. Shell Programming and Scripting
This has probably been asked 100 times, but I couldn't find any articles on point. I have a script that runs on the last day of every month at 11:30pm. If cats a number of input tables that were created the previous month (or earlier), combines them into one master file and erases the indivual... (1 Reply)
Discussion started by: beilstwh