What if you do something along the lines of
Code:
if (today == 'Friday') &&
month(today) == month(today+4 days) &&
month(today) != month(today+11 days)
do stuff
Pseudocode obviously, but the logic should be sound and it should be very easy to implement with date's format code and -d flag.
today == 'Friday' ensures that today is Friday (obviously)
month(today) == month(today+4) ensures that the following Tuesday is still part of the same month
month(today) != month(today+11) ensures that the following Tuesday is the last Tuesday in the month
edit: something along the lines of
Code:
thisday=$(date +%u)
thismon=$(date +%m)
thisp4mon=$(date -d "+4 days" +%m)
thisp11mon=$(date -d "+11 days" +%m)
if [[ $thisday -eq 5 && $thismon -eq $thisp4mon && $thismon -ne $thisp11mon ]]; then
echo "This is the Friday before the last Tuesday of the month!"
fi