date -r switch missing on solaris 10
Posted on 2008-06-18
Hi. My Bash script:
date -r $PATH/$file'+DATE MODIFIED: %m/%d/%y TIME:%H:%M:%S'
works on our Solaris 8 server i.e.,:
DATE MODIFIED: 03/10/08 TIME:19:19:48
but fails on Solaris 10 with this error:
date: illegal option -- r
usage: date [-u] mmddHHMM[[cc]yy][.SS]
date [-u] [+format]
date -a [-]sss[.fff]
What's the remedy? I need to print out the date modified for a file in a script that processes a list of files. I need to be able to run this on both boxes.
Thanks for any help,