Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


Get all business days from week including today

Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Get all business days from week including today

I am trying to get last 5 business day [excluding sat and sun].
trying
Code:
for d in Mon Tue Wed Thu Fri
do
date +%Y%m%d -d "last $d"
done

gives me [provided]
Code:
date
Thu Oct 20 23:56:26 EDT 2016
20161017
20161018
20161019
20161013
20161014

expected output should be
Code:
20161017
20161018
20161019
20161020
20161014


Last edited by Don Cragun; 10-21-2016 at 05:24 AM.. Reason: Fix existing and add missing CODE tags.
# 2  
Moderator's Comments:
Mod Comment This message was posted in the wrong forum. Please respond to this issue in the thread Get business days including today's date. This thread is closed.
This User Gave Thanks to Don Cragun For This Post:
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Get business days including today's date
abhii
I am trying to get last 5 business day . trying for d in Mon Tue Wed Thu Fri do date +%Y%m%d -d "last $d" done gives me date Thu Oct 20 23:56:26 EDT 2016 20161017 20161018 20161019 20161013 20161014 expected output should be 20161017 20161018 20161019 20161020... Shell Programming and Scripting
2
Shell Programming and Scripting
Working out days of the week and processing file in 3 working days
twinion
Hi guys i need advice on the approach to this one...... I have a file say called Thisfile.20130524.txt i need to work out from the date 20130524 what day of the week that was and then process the file in 3 working days. (so not counting saturday or sunday....(will not worry about bank...... Shell Programming and Scripting
2
Shell Programming and Scripting
Calculate 30/31 days from today date script
coolgoose85
Hi Guys, I was working some time ago n was in need to calculate date 30/31 days from today including Feb (Leap yr stuff). Today date is variable depending on day of execution of script. I tried searching but was not able to get exactly what I needed....So at that I time I implemented by my own...... Shell Programming and Scripting
3
Shell Programming and Scripting

Featured Tech Videos