Get the last ten business days in a Unix shell script
Shell script to get the last 10 weekdays and run some task for each date over an element array. #!/usr/bin/bash n=10 today=$(date +’%Y-%m-%d’) for ((d=1; n>0; d++)) do # Adjust this next line to get the date format you require, e.g. +’%Y%m%d’ date=$(date –date “$today -$d day”) nday=$(date –date “$today -$d day” +’%w’) weekdays_date=$(date –date…