Solved

date -r switch missing on solaris 10

Posted on 2008-06-18
4
1,280 Views
Last Modified: 2013-12-27
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,

Mirek
0
Comment
Question by:drozdzowski
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 total points
Comment Utility
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
Not a POSIX switch.
ls command has manual and lists file times.
0
 
LVL 40

Expert Comment

by:omarfarid
Comment Utility
0
 

Author Closing Comment

by:drozdzowski
Comment Utility
Thank you.  This also explains why some other commands where not working on our out-of-the-box new server, such as 'whoami'.

Mirek

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now