Any one help me how to check the day ocuurence in a month in shell script
the day is monday means where this monday is first monday or second one
Shell script an option
I thought I responded about a week ago, still don't see it
try something along the lines of
depending on what you are looking for this should give a starting point
DayOfWeek=$(date +%a) ## returns Sun,Mon......
if [ $DayOfWeek == "Mon" ] ; then
echo " ok Its a Monday"
if [ $DayOfMonth -le 7] ; then
echo " Must be first Monday of month"
elif [ $DayofMonth -le 14 ] ; then
echo " Must be second Monday of Month"
echo " Not a Monday its $DayOfWeek "