I am trying to get last 5 business day [excluding sat and sun].
trying
for d in Mon Tue Wed Thu Fri
do
date +%Y%m%d -d "last $d"
done
gives me [provided]
date
Thu Oct 20 23:56:26 EDT 2016
20161017
20161018
20161019
20161013
20161014
expected output should be
20161017
20161018
20161019
20161020
20161014