Solved

date -r switch missing on solaris 10

Posted on 2008-06-18
4
1,283 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
ID: 21814566
0
 
LVL 61

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to create custom bootable image of Centos 7.2 4 99
check unix curl command return value 7 83
Sed question 2 68
Python Assistance 7 72
Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

914 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

17 Experts available now in Live!

Get 1:1 Help Now