Solved

date -r switch missing on solaris 10

Posted on 2008-06-18
4
1,295 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

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…
#Citrix #POC #XenDesktop #vCenter #VMware #ESX
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 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…

695 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