-
Shell script
Any one help me how to check the day ocuurence in a month in shell script
Example :
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
DayOfMonth=$(date +%d)
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"
fi
else
echo " Not a Monday its $DayOfWeek "
fi
depending on what you are looking for this should give a starting point
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|