fdt=`date +%d`
if [ $fdt -eq 1 ] ; then
echo 'today is first day of month'
else
echo 'today is not first day of the month'
fi
I am pretty sure this is not what you need. You need to explain what you want to accomplish. NOT how you want to do it. Why do I say this? Because the correct answer I gave is not very useful.
I need on the first date of each month run the program, which is supposed to run first day of each month.
on AIX
if [ $frst -eq 1 ]
will not work. It should be something like
if [ "${frst}" = "1" ]
then
run the program
else
echo "Not the first date
fi
or
if [ "${frst}" = "01" ]
then
run the program
else
echo "Not the first date
fi
to force the frst variable to evaluate as an integer, in some old shells.
Since I do not know either your shell or its version I cannot help you any more than that.
Anyway, why do you not create a cronjob that executes on day one of any month? crontab -e lets you edit your crontab
Ex: run at 10:10 only on the first