10 More Discussions You Might Find Interesting
1. HP-UX
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)
Discussion started by: kmarcus
20 Replies
2. HP-UX
HI,
Can anyone tell me how to pull the date and file name separated by a space using the find command or any other command. I want to look through several directories and based on a date timeframe (find -mtime -7), output the file name (without the path) and the date(in format mmddyyyy) to a... (2 Replies)
Discussion started by: lnemitz
2 Replies
3. Shell Programming and Scripting
Problem : we need a command that will give previous day date and previous day should be mon-fri only.
Example :if we are running a command on Monday , it will give Friday ‘s date not Sunday’s .
Few more restrictions :
Command should be working in NM n/w.
Hard coding of date should be avoided.... (11 Replies)
Discussion started by: Downsouth
11 Replies
4. UNIX for Dummies Questions & Answers
Hi Experts,
I have a date validation script in that i will validate the date for a given format and search in the logs for that date. The script logic is very simple like below.
Validate_Date()
{
is_valid=1
while
do
date_format=$(date "+$1")
echo -e "Please enter the $2 date like... (6 Replies)
Discussion started by: senthil.ak
6 Replies
5. Shell Programming and Scripting
Hi all,
Need an urgent help on the below scenario.
script:
awk -F","
'BEGIN { #some variable assignment}
{ #some calculation and put values in array}
END {
year=#getting it from array and assume this will be 2014
month=#getting it from array and this will be 05
date=#... (7 Replies)
Discussion started by: vijaidhas
7 Replies
6. Shell Programming and Scripting
Hi,
in my script, i take the last month by
a=$(date --date '1 month ago' +%Y%m)
i expect that it give me in this month "March" as result 201402,
but linux gave me 201403.
IMPe@ABC123:> ~/date --date '1 month ago' +%Y%m
201403
i'm reasonably confused. Any idea?
Thanks in advance,
... (2 Replies)
Discussion started by: IMPe
2 Replies
7. Shell Programming and Scripting
Hello all,
I'm trying to substract 1 minute from the current date and take the hour and minute (for filename purpose).
1) If I want hour an minute from current time I can use:
timetmp=$(date +"%H:%M")
2) To substract 1 minute from current time I can use:
timetmp=$(date --date "$dte -1... (8 Replies)
Discussion started by: Lord Spectre
8 Replies
8. Shell Programming and Scripting
Hi,
does anybody know how to format `date` command correctly to return the day of the week? Thanks -A
I work in ksh.... (1 Reply)
Discussion started by: aoussenko
1 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I could not find the exactly same post here.. so I will explain what I did to get the last month using date command.
I used
date +%Y-%m -d "-1 months"
to get the last month. However, the returned value of above command on 2009/10/31 was 2009 10 and not 2009 09.. and the... (9 Replies)
Discussion started by: tigersk
9 Replies
10. Shell Programming and Scripting
I wan to convert any field having date in the file from the follwoing format 5/1/2003 to 2003-05-01. This file is tab delimited. Please help. (2 Replies)
Discussion started by: dsravan
2 Replies