10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
I am trying to add few (say 3 days) to sysdate using -
date -d '+ 3 days' +%y%m%d
and it works as expected.
But how to add few (say 3 days) to a literal date value and how bash treats a literal value as a date. Can we say just like in ORACLE TO_DATE that my given literal date value... (2 Replies)
Discussion started by: pointers1234
2 Replies
2. Shell Programming and Scripting
I am not able to fetch first date and last date previous month
date -d -1month +%Y-%m-%d
date -d -1month +%Y-%m-%d
I need two format dd-mm-yyy
previous month 01-03-2016
previous month 31-03-2016
and also only date 1 to 31
Aprriciate your replay (4 Replies)
Discussion started by: jagu
4 Replies
3. Shell Programming and Scripting
Hi,
I want two dates one will be the current date and the other one will be just one month before. Say if current month is 11/4/2014 then the other date should be 11/3/2014.
#!/bin/ksh
currentDtae=`date`
oneMonthBefore= ?
I dont know how to do it. Went through some of the related threads... (15 Replies)
Discussion started by: Sharma331
15 Replies
4. Shell Programming and Scripting
Hi All,
I need to find all files other than first two files dates & last file date for month and month/year wise list.
lets say there are following files in directory
Mar 19 2012 c.txt
Mar 19 2012 cc.txt
Mar 21 2012 d.txt
Mar 22 2012 f.txt
Mar 24 2012 h.txt
Mar 25 2012 w.txt
Feb 12... (2 Replies)
Discussion started by: Makarand Dodmis
2 Replies
5. Shell Programming and Scripting
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
6. UNIX for Dummies Questions & Answers
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
Hi All,
I need to run a job every month at the beginning of the month which is scheduled through autosys, lets say on 03/01/2010. I need to pass the last month's i.e February's first_date = 02/01/2010 and last_date = 02/28/2010 as variables to a stored procedure. Can somebody please pass... (2 Replies)
Discussion started by: vigdmab
2 Replies
8. UNIX for Dummies Questions & Answers
Hello,
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 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I'm using ls -laR to print out a list of file and folders. I want to print only the permission, file size and file name. Also, excluding the '.' and '..'.
result from ls -laR:
total 6
drwxr-xr-x 8 user staff 512 Nov 28 16:17 .
drwxr-x--- 16 user staff 1024... (3 Replies)
Discussion started by: minifish
3 Replies
10. Shell Programming and Scripting
Hi expert,
I want to retrieve yesterday su log.
How to calculate and assign variable value ( 06/23 ) in myVariable ?
#!/bin/sh
myVariable=yesterday date in month/date
cat /var/adm/sulog | grep $myVariable > file.txt
many thanks! (5 Replies)
Discussion started by: skully
5 Replies