Get Date of Previous and next Monday

Hi,

I would like to know how to get Previous Monday and Next Monday from the current date..

thanks

What's your system?

You have a history of vague posts.
Please post your precise Operating System and version and what Shell you are running.
Please also post the reasoning behind this question and what you are trying to achieve. i.e. please give us the problem not the solution.

This is to run Korn Shell in AIX 7

I want to run query for Previous monday to next monday for the given date...

if you have perl and Date::Manip module is installed, then try this

 
#!/bin/perl
use Date::Manip;
$date = UnixDate(Date_GetPrev("today","mon",0),"%Y-%m-%d");
print $date;
$date = UnixDate(Date_GetNext("today","mon",0),"%Y-%m-%d");
print $date;

ksh93, since version h:

$ printf "%(%Y-%m-%d)T\n" "last monday" monday
2012-04-30
2012-05-07
1 Like