If you are going to be dealing with dates frequently, you might want to look at a package called dateutils. It is available on several platforms. I use Debian, but it's available even on Apple/macOS via brew. Here is a demonstration, note that the key command is simply dateutils.deq:
$ ./s4
Environment: LC_ALL = en_US.utf8, LANG = en_US.utf8
(Versions displayed with local utility "version")
OS, ker|rel, machine: Linux, 3.16.0-7-amd64, x86_64
Distribution : Debian 8.11 (jessie)
bash GNU bash 4.3.30
dateutils.dseq dseq 0.3.1
specimen (local) 1.17
-----
Starting, ending dates:
2019-07-31, 2019-10-01
-----
Results, end-points:
Edges: 5:5:5 of 63 lines in file "f1"
31-07-2019
01-08-2019
02-08-2019
03-08-2019
04-08-2019
---
29-08-2019
30-08-2019
31-08-2019
01-09-2019
02-09-2019
---
27-09-2019
28-09-2019
29-09-2019
30-09-2019
01-10-2019
Additional details:
Code:
dateutils.dseq Generate a sequence of date/times from FIRST to LAST, ... (man)
Path : /usr/bin/dateutils.dseq
Package : dateutils
Home : http://www.fresse.org/dateutils
Version : 0.3.1
Type : ELF 64-bit LSB shared object, x86-64, version 1 ( ...)
Help : probably available with -h,--help
Home : https://github.com/hroptatyr/dateutils (doc)
Hi Guys,
My first post..:)
Right...I want to move existing files (with some date in their name) currently in $mainftp, to $mainfolder/$foldate/system1.
I'd like to be able to increment date in the for loop? Is this possible or should I use a different technique.
The script return the... (4 Replies)
I need to increment a date value through shell script.
Input value consist of start date and end date in DATE format of unix.
For eg.
I need increment a date value of 1/1/09 to 31/12/09 i.e for a whole yr.
The output must look like
1/1/09
2/2/09
.
.
.
31/1/09
.
.
1/2/09
.
28/2/09... (1 Reply)
Hi,
Iam new to scripting language.:o
can someone help me out solving this thread?hopingly ya....:)
I want to write a script which connects to db and searches the count in a table which has date column and id column.
If the count is not equal to 0 then it should increment the date with the one... (4 Replies)
Hi,
I have a variable lets say DATA_DATE.
I have to pass some value to this variable in YYYYMMDD format.
lets say today I have passed this variable as :
DATA_DATE=20100107
Then pls help me how to calculate another variable DATA_DATE1 (which is DATA_DATE+1).
The code should work... (3 Replies)
hi Friends,
Today_Dt=`date "+%Y-%m-%d"`
So the Today date is 2010-05-03
I have a file which has date values as below
2010-04-27
2010-04-02
2010-04-18
2010-04-28
2010-04-29
.. (1 Reply)
hi experts,
my requirement is like this i need to develop a shell script to update date part with new incremental date time in file some 'X' which is kept at some server location incrementing every two hours.as i am new to this scripting i need support from u people,thanx in advance (1 Reply)
Hi all,
I need to increment date at run time.
Example:
I need to write a shell script with two parameters.
1. country code like (US,UK, IND.....)
2. Date range from_date to to_date (20070101 to 20070331)
I need to run shell script like this
country_info.sh US 20070101 20070331
... (3 Replies)
hey guys,
I need to incerement the date variable for instance
echo `date '+%F %H:%M:00'`
this produces
2014-08-02 20:05:00
-I will grant this to : $Datehour and need to assign 1 hr from now to $Datelasthour
-the script time will be used to talk to DB system information.
however... (4 Replies)
Discussion started by: mo_VERTICASQL
4 Replies
LEARN ABOUT MOJAVE
backlightdtester
BacklightdTester(1) BSD General Commands Manual BacklightdTester(1)NAME
BacklightdTester, Other_name_for_same_program(), Yet another name for the same program. -- This line parsed for whatis database.
SYNOPSIS
BacklightdTester, [-abcd] [-a path] [file] [file ...] arg0 arg2 ...
DESCRIPTION
Use the .Nm macro to refer to your program throughout the man page like such: BacklightdTester, Underlining is accomplished with the .Ar
macro like this: underlined text.
A list of items with descriptions:
item a Description of item a
item b Description of item b
A list of flags and their descriptions:
-a Description of -a flag
-b Description of -b flag
FILES
/usr/share/file_name FILE_1 description
/Users/joeuser/Library/really_long_file_name FILE_2 description
SEE ALSO a(1), b(1), c(1), a(2), b(2), a(3), b(3)Darwin May 31, 2019 Darwin