?
Solved

date -r switch missing on solaris 10

Posted on 2008-06-18
4
Medium Priority
?
1,312 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 2000 total points
ID: 21814566
0
 
LVL 62

Expert Comment

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

Expert Comment

by:omarfarid
ID: 21814638
0
 

Author Closing Comment

by:drozdzowski
ID: 31468436
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

840 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