Sponsored Content
Top Forums Shell Programming and Scripting Shell Script to Loop through Quarter dates Post 303002560 by krux_rap on Sunday 27th of August 2017 02:20:19 PM
Old 08-27-2017
A few questions to get more information:

1) Could you check again if that output is really for 20180105 and not 20170705 ?
Code:
Yes I still see same output for both inputs

$ perl get_quarter_dates.pl 20180105
2016-07-01 2016-09-30
2016-10-01 2016-12-31
2017-01-01 2017-03-31
2017-04-01 2017-06-30

2) What output do you get for 20170705 ?
Code:
$ perl get_quarter_dates.pl 20170705
2016-07-01 2016-09-30
2016-10-01 2016-12-31
2017-01-01 2017-03-31
2017-04-01 2017-06-30

3) Are there any other dates, besides 20180105, for which the output is incorrect ?
Tried all months except for Jan remaining all looks perfect

4) Could you run the program for all the dates I ran it, in my post?
Code:
$ perl get_quarter_dates.pl 20170705
2016-07-01 2016-09-30
2016-10-01 2016-12-31
2017-01-01 2017-03-31
2017-04-01 2017-06-30
$ perl get_quarter_dates.pl 20170805
2017-07-01 2017-07-31
$ perl get_quarter_dates.pl 20170905
2017-07-01 2017-08-31
$ perl get_quarter_dates.pl 20171005
2017-07-01 2017-09-30
$ perl get_quarter_dates.pl 20171105
2017-07-01 2017-09-30
2017-10-01 2017-10-31
$ perl get_quarter_dates.pl 20171205
2017-07-01 2017-09-30
2017-10-01 2017-11-30
$ perl get_quarter_dates.pl 20180105
2016-07-01 2016-09-30
2016-10-01 2016-12-31
2017-01-01 2017-03-31
2017-04-01 2017-06-30
$ perl get_quarter_dates.pl 20180205
2017-07-01 2017-09-30
2017-10-01 2017-12-31
2018-01-01 2018-01-31
$ perl get_quarter_dates.pl 20180305
2017-07-01 2017-09-30
2017-10-01 2017-12-31
2018-01-01 2018-02-28
$ perl get_quarter_dates.pl 20180405
2017-07-01 2017-09-30
2017-10-01 2017-12-31
2018-01-01 2018-03-31
$ perl get_quarter_dates.pl 20180505
2017-07-01 2017-09-30
2017-10-01 2017-12-31
2018-01-01 2018-03-31
2018-04-01 2018-04-30
$ perl get_quarter_dates.pl 20180605
2017-07-01 2017-09-30
2017-10-01 2017-12-31
2018-01-01 2018-03-31
2018-04-01 2018-05-31
$ perl get_quarter_dates.pl 20180705
2017-07-01 2017-09-30
2017-10-01 2017-12-31
2018-01-01 2018-03-31
2018-04-01 2018-06-30
$ perl get_quarter_dates.pl 20180805
2018-07-01 2018-07-31
$ perl get_quarter_dates.pl 20190105
2017-07-01 2017-09-30
2017-10-01 2017-12-31
2018-01-01 2018-03-31
2018-04-01 2018-06-30

5) Did you make any changes in the Perl program I posted ?

Nope, Just copied as it is

6) What is your Perl version? The following command shows the version:

Code:
perl -v

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

Copyright 1987-2009, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to compare the dates in shell script

Hi How to compare created or modified date of two files help needed thanks Vajiramani :) (9 Replies)
Discussion started by: vaji
9 Replies

2. Shell Programming and Scripting

Generate quarter dates with begin date and end date

Hi All, I am trying to generate quarter dates with user giving input as begin date and end date. Example: Input by user: begin_date = "2009-01-01" end_date = 2010-04-30" required output: 2009-01-01 2009-03-31 09Q01 2009-04-01 2009-06-30 09Q02 . . till 2010-01-01 2010-03-31 10Q01 ... (9 Replies)
Discussion started by: sol_nov
9 Replies

3. Shell Programming and Scripting

Difference of 2 dates in shell script

Hi., After retrieving values from DB I have two datestamps in format: 12/01/2010:05:40:00 AM and 12/01/2010:06:00:00 PM. general time format: MM/DD/YYYY:HH:MM:SS AM or PM Any quick solution to get the difference of two in the format : 1 day(s) 12:20:00 Thanks., (6 Replies)
Discussion started by: IND123
6 Replies

4. UNIX for Dummies Questions & Answers

Find Quarter Start and End Dates

Dear Members, Depending on the current date i should find out the start and end dates of the quarter. ex: Today date is 14-Nov-2011 then Quarter start date should be Oct 1 2011 and Quarter End date should be Dec 31 2011. How can i do this? Thanks Sandeep (1 Reply)
Discussion started by: sandeep_1105
1 Replies

5. Shell Programming and Scripting

append dates going forward from today to certain line in shell script

Hi there, I have a requirement to append dates going forward to a certain line in a file. I'm not sure of how to go about this. Any help will be greatly appreciated. Thanks Slyesco:wall: (2 Replies)
Discussion started by: Slyesco
2 Replies

6. Shell Programming and Scripting

Shell script to calculate difference between 2 dates

shell script to calculate difference between 2 dates (3 Replies)
Discussion started by: gredpurushottam
3 Replies

7. Shell Programming and Scripting

Need Help:Shell Script for Solaris to change the dates in a file by one week

I have to increase the date by one week in an input when script is executed in solaris. I was able to acheive this using ksh script that is working in Linux enivironment, when i execute the same script in Solaris i am getting below error: /var/tmp\n\r-> ./script.ksh date: illegal option -- d... (3 Replies)
Discussion started by: sriramanaramoju
3 Replies

8. Shell Programming and Scripting

Shell script to work on dates

Hi Sir/Madam I have a file data.txt like below file_name date_of_creation x 2/10/2012 y 8/11/2010 z 11/3/2013 a 2/10/2013 b 3/10/2013 c ... (4 Replies)
Discussion started by: kumar85shiv
4 Replies

9. Shell Programming and Scripting

Comparing dates in shell script

Hi All, I have a date variable say dt="2014-01-06 07:18:38" Now i need to use this variable to search a log and get the entries which occured after that time. (1 Reply)
Discussion started by: Girish19
1 Replies

10. Linux

How to calculate the quarter end date according to the current date in shell script?

Hi, My question is how to calculate the quarter end date according to the current date in shell script? (2 Replies)
Discussion started by: Divya_1234
2 Replies
VERSION(1SSL)							      OpenSSL							     VERSION(1SSL)

NAME
openssl-version, version - print OpenSSL version information SYNOPSIS
openssl version [-help] [-a] [-v] [-b] [-o] [-f] [-p] [-d] [-e] DESCRIPTION
This command is used to print out version information about OpenSSL. OPTIONS
-help Print out a usage message. -a All information, this is the same as setting all the other flags. -v The current OpenSSL version. -b The date the current version of OpenSSL was built. -o Option information: various options set when the library was built. -f Compilation flags. -p Platform setting. -d OPENSSLDIR setting. -e ENGINESDIR setting. NOTES
The output of openssl version -a would typically be used when sending in a bug report. COPYRIGHT
Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>. 1.1.1a 2018-12-18 VERSION(1SSL)
All times are GMT -4. The time now is 06:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy