Sorry if its repetition of any old post. If so, kindly redirect.
Iam working on a shell script in AIX where we get a date from a file/command line.
Now, i have to compare the current date with the input date and see the number of days difference.
I tried to google for its solution, but everywhere ended up with no proper solution.
Here i cant set the "date" variable, as iam not a root user.
Any inputs would be of great help.
解决方案
For anything slightly more complicated I'd suggest using datecalc (you can find a version at http://www.unix.com/unix-dummies-questions-answers/4870-days-elapsed-between-2-dates.html#post16559). It's implementable in most UNIX dialects.