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
hello,
I have many files called day001, day002, day003 and I want to rename them by day20070101, day20070102, etc.
I need to do it for several years and leap years as well.
What is the best way to do it ?
Thank you. (1 Reply)
Discussion started by: Ggg
1 Replies
3. Shell Programming and Scripting
Hello All,
I am writing a script in Sun Solaris
I want the date for "day before yesterday", i got the yesterday's date by this command TZ=GMT+24 date +%b" "%d.
Please suggest me some code to get the date for day before yesterday (6 Replies)
Discussion started by: anand2308
6 Replies
4. Shell Programming and Scripting
Hi,
How can I convert day of year value in format(yy,doy) to normal formatted (dd.mm.yyyy) string also all of them with awk or awk system function?
in_file.txt
---------
12,043
12,044
12,045
12,046
out_file.txt
----------
12.02.2012
13.02.2012
14.02.2012
15.02.2012
imagine... (5 Replies)
Discussion started by: kocaturk
5 Replies
5. Shell Programming and Scripting
Hi
I want to convert the day of the year(yyyyddd) to date in mmddyy format
Example:
input is 2005029 --------> 29th day of 2005
I have to get the output as 01292005 ---> jan 29th 2005
I've to do this in K-Shell
There were threads that dealt with coverting date to day of the year but I... (3 Replies)
Discussion started by: sudhamayeev
3 Replies
6. AIX
Hello,
How do I convert unix timestamp value to 'normal' date format - to get year month and day values ?
Looks like it's easy to do using GNU date (linux systems). But how do I do tthis on AIX ?
I don't want to write C program, any ways to do that using unix shells ?
thanks (1 Reply)
Discussion started by: vilius
1 Replies
7. Shell Programming and Scripting
Hi
i am having a backup folder wherein i will be having the files ftp ed to remote server, i need to keep only the data of last two days and remove the old log files.
how can i achieve this ?
i have tried...
#!/bin/bash
D=`date +'%d'`
oldday=`expr $D - 2`
rm /sent/data-$oldday*
echo... (8 Replies)
Discussion started by: aemunathan
8 Replies
8. Shell Programming and Scripting
Hi Im trying to concatenate a specific file from each day in a year/month/day folder structure using Bash or equivalent. The file structure ends up like this:
2009/01/01/products
2009/01/02/products
....
2009/12/31/products
The file I need is in products everyday and I need the script to... (3 Replies)
Discussion started by: Grizzly
3 Replies
9. 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
10. Shell Programming and Scripting
I have a date that looks like this:
2008/100:18:40:47.040
I need it to look like this:
2008 04 09 18 40 47 040
I have looked at datecalc and it doesn't seem like it takes the day of year for this year (or whatever year is input) and converts it into month and day. It also has to account... (2 Replies)
Discussion started by: ajgwin
2 Replies