What you said == first occurrence of Thursday in a month, regardless of Wednesday.
Code:
#!/bin/ksh
is_first_thursday()
{
retval=0
typeset -i day=$(date +%d)
if [[ $day -lt 8 ]]; then
if [[ "`date +%A`" = "Thursday" ]] ; then
retval=1
fi
fi
echo $retval
}
usage:
Code:
ok=$(is_first_thursday)
if [[ $ok - eq 1 ]] ; then
# do stuff because it is first thursday
fi