![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | Calendar | Search | Today's Posts | Mark Forums Read |
| SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems . |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
date -d illegal option in Solaris
Hi All,
Is it possible to run date -d option in Solaris? Do we have a work around so that -d option will be recognized by solaris as it is recognized by linux. I need this since i am using this in scripting and it works in Linux box. my problem is it doesn't work in solaris box. QUERY="rpm -qa --queryformat '%{installtime} %{name}-%{version}-%{release}-%{arch} \n'| awk '{ if ( \$1 > '`date -d "1 week ago" +%s`') print \$2 }'" Anyone can help me on this please ? ---------- Post updated at 02:46 PM ---------- Previous update was at 02:31 PM ---------- -Or- Do we have equivalent commands for `date -d "1 week ago" +%s` in Solaris ? |
|
|||
|
If you are using a recent enough Solaris release, Gnu date might already be there: Code:
$ uname -a SunOS pcjll 5.11 snv_128 i86pc i386 i86pc $ /usr/gnu/bin/date -d "now -7 days" "+%s" 1258453453 otherwise, you have these nawk and perl solutions: Code:
$ nawk 'BEGIN{print srand()-(7*24*60*60)}'
1258453618
$ perl -e 'printf("%s\n",time-(7*24*60*60));'
1258453627
|
|
|||
|
Thank guys for all your post..
God Bless you all! |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Please help --setfacl: illegal option -- R | manoj_dahiya22 | SUN Solaris | 2 | 03-14-2009 07:52 AM |