1828478 Members
2883 Online
109978 Solutions
New Discussion

Shell script

 
Maheshvs
New Member

Shell script

Hi
I need to check today is first date of the month or not .

Thanks in advance,
Mahesh
3 REPLIES 3
Luk Vandenbussche
Honored Contributor

Re: Shell script

if [ `date +%d` -eq 01 ]
then
...
else
...
fi
swarup kundu
Advisor

Re: Shell script

date=`date +%d`
if [ $date -eq 1 ]
then
echo "Today is First day of Month"
else
echo "Today is not First day of Month"
fi
Arturo Galbiati
Esteemed Contributor

Re: Shell script

if [[ $(date +%d) = 01 ]]; then
.....
fi

HTH,
ARt