I have tried to calculate number of days from January 1st to given date in same year. Option -d for UNIX command isn't working
date -d
date: illegal option -- d
Usage: date [-u] [+format]
date [-u] [mmddhhmm[[cc]yy]]
date [-a [-]sss.fff]
I'm using this script but is too long. Is there a simple way to calculate a nuber of days?
EDIT Result of a script:
$ ksh datecalc -a 2013 2 5 - 2013 1 1
$ 35