Sponsored Content
Top Forums Shell Programming and Scripting display all dates 200 days back Post 302343507 by jim mcnamara on Wednesday 12th of August 2009 04:49:28 PM
Old 08-12-2009
I hope this is not a class assignment..
Code:
#!/bin/ksh

ago()
{
   perl -e ' my $delta = $ARGV[0] * -1;
             @t=localtime( time - ( 86400 * $delta )); 
             printf("%02d-%02d-%d", $t[3], $t[4]+1, $t[5]+1900); ' $1
}

wh=200
while [[ $wh -ge 0 ]] 
do
   echo $(ago $wh)             
   wh=$(( $wh - 1 ))
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

days elapsed between 2 dates

does anybody know how to find out the number of days elapsed between 2 dates e.g. days elapsed between 020212 and 020110 (YYMMDD format) Thanking you in advance. Ravi. (1 Reply)
Discussion started by: rkkiran
1 Replies

2. Shell Programming and Scripting

Difference between two dates in no of days ???

Hi All How to get the difference between two dates in no of days ??? My date format is like this YYYY/MM/DD. I have to get the no of days between two dates in the given format. I tried to search the forum but nothing came up similar to my requitement. Your help will be appreciated. ... (1 Reply)
Discussion started by: csaha
1 Replies

3. Shell Programming and Scripting

Days difference between two dates

Hello, I would like to find out the number of days between two dates of the format yyyy-mm-dd. Any help on this is highly appreciated. Thanks. (6 Replies)
Discussion started by: Data469
6 Replies

4. UNIX for Dummies Questions & Answers

display all dates 200 days back

i need help! can someone help me please? i try to calculate date under unix (ksh)...AIX operating system. I have to find the date 200 days from today's date. then the script should loop 200 times and display on command line every day's date until the current date. example: todays date:... (1 Reply)
Discussion started by: pavan_test
1 Replies

5. Shell Programming and Scripting

Get number of days between given dates

Hi I need one single command to get number of days between two given dates.datecalc is not working. ex. fromdate:01.04.2010 todate :24.04.2010 i should get the out put as 23 Thanks in advance (4 Replies)
Discussion started by: suryanarayana
4 Replies

6. Shell Programming and Scripting

days are between the two dates?

I have two times in the format of YYMMDD. Does anyone know an easy way in ksh for me to display how many days are between the two dates? Example1: X=101202 Y=101205 There are 3 days between X & Y Example2: X=101202 Y=111202 There are 365 days between X & Y Example3: X=101205... (3 Replies)
Discussion started by: oldman2
3 Replies

7. UNIX for Advanced & Expert Users

How to get the sunday days between two dates?

Hi Am using Unix Ksh I have a two date input as DATE1=02/12/2012 DATE2=30/12/2012 I Need the output as only sunday date 02/12/2012 09/12/2012 16/12/2012 23/12/2012 30/12/2012 can anyone pls help me.. thanks in advance... (2 Replies)
Discussion started by: Venkatesh1
2 Replies

8. Shell Programming and Scripting

Display previous days dates in ksh

---------- Post updated at 03:42 AM ---------- Previous update was at 03:38 AM ---------- Sorry for a duplicate post, my post at the first place could not appear due to some net issue on my machine. Here is what i posted earlier: Hi, i am using ksh in Solaris, i wanted to assign today's,... (5 Replies)
Discussion started by: pr5439
5 Replies

9. UNIX for Dummies Questions & Answers

How to display file whose size is between 100 to 200 kb ???

help me (1 Reply)
Discussion started by: sonu pandey
1 Replies

10. Shell Programming and Scripting

Get number of days between 2 dates

Gents. Please can u help. I would like to calculate the days between two dates. Example file1 ( previous date) file1 - Input file 9/29/2010 10195 9/29/2010 1057 2/2/2016 10 2/2/2016 10169 2/2/2016 1057 2/3/2016 10005 2/3/2016 10014 In file2 I add the actual date using this code.... (9 Replies)
Discussion started by: jiam912
9 Replies
rmdel(1)						      General Commands Manual							  rmdel(1)

NAME
rmdel - remove a delta from an SCCS file SYNOPSIS
SID file ... DESCRIPTION
The command removes the delta specified by the SID from each named SCCS file. The delta to be removed must be the newest (most recent) delta in its branch in the delta chain of each named SCCS file. In addition, the SID specified must be that of a version being edited for the purpose of making a delta (i.e., if a p-file (see get(1)) exists for the named SCCS file, the SID specified must appear in any entry of the p-file). If a directory is named, behaves as though each file in the directory were specified as a named file, except that non-SCCS files (last com- ponent of the path name does not begin with and unreadable files are silently ignored. If a name of is given, the standard input is read; each line of the standard input is taken to be the name of an SCCS file or directory to be processed; non-SCCS files and unreadable files are silently ignored. When is specified on the command line, all following arguments are treated as file names. The permissions to remove a delta are either (1) if you make a delta you can remove it; or (2) if you own the file and directory you can remove a delta. EXTERNAL INFLUENCES
Environment Variables determines the locale for the interpretation of text as single-byte and/or multi-byte characters. determines the language in which messages are displayed. also determines the local language equivalent of the affirmative string ("yes"). If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty variable. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support Single-byte and multi-byte character code sets are supported. DIAGNOSTICS
Use sccshelp(1) for explanations. FILES
See delta(1). See delta(1). SEE ALSO
delta(1), get(1), sccshelp(1), prs(1), sccsfile(4). STANDARDS CONFORMANCE
rmdel(1)
All times are GMT -4. The time now is 10:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy