Hi,

I have dates like 20130402 (y-m-d i.e 2ndApr13)
Dates are 20130402, 20130404, 20130409, 20130412

if date is 20130402 out put is 20130408 , if date is 20130412 output is 201304015

dd="20130402"
echo $dd
This gives me current dates next monday , date -d "next monday" +%Y%m%d
How to find the next monday of this given date?

Try this

dd="20130409"
date -d $dd -d "next monday" +%Y%m%d

--ahamed

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.