I have a file with name and date---
I want to search for the current date and get the name for that date. If current date is not found, go back 1 day and search and so on till it finds the user.
In this case, if I am searching for userC, i have to start from current date and go on till i hit 16-05-2014.
Please note, my search is based on date.
Thanks
Last edited by Franklin52; 07-11-2014 at 10:27 AM..
Reason: Code tags
current date command runs well
awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
subtract 30 days fails
awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
SunOS -s 5.10 Generic_147440-04 sun4u sparc SUNW,SPARC-Enterprise
Hi,
In a folder, there are files. I have a script which reads the current date and subtract the modification date of each file.
How do I achieve this?
Regards,
Joe (2 Replies)
Hi all,
I have been researching to obtain SSL certification expiry for most of our webistes. For some cases, some hosts where not directly accessible so i finally got a solution working with curl using my proxy. This lists the expiry date which i'm finally looking for.
# curl --proxy... (4 Replies)
Hi,
Can you please let me know code for the below (in korn shell)
a) Subtract month(s) from given date
b) Subtract day(s) from give date
c) Subtract month(s) from given timestamp
d) Subtract day(s) from give timestamp (1 Reply)
Hi,
I am reading a particular date from a file using below command
WFLWDATE=$(sed '2q;d' FileA.prm)
The echo command outputs the correct date in variable WFLWDATE
Now I want to subtract 5 minutes from this variable. I am on AIX and unable to get anything working as expected.
Can you... (1 Reply)
the given time is:
12:13:00
how do i subtract a 10 minutes from any given time?
date '12:13:00' '-10 min'
also tried this:
date +12:13:00 '-10 min' (2 Replies)
Hi
I have a date in a variable in Unix script and have to subtract -1 from the date.
fromdate='07/13/2009'
Now we want to subract one day from it i.e the end result should be '07/12/2009'
Any suggestions?
Thanks (2 Replies)
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)
I Have a long file like this
123122312 05/06/12
123123456 05/06/14
I want to take the difference of dates in two lines & print difference sidewise for the whole long files.
Pl help me out. (1 Reply)