Re: GNU date on RHES 4.x

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 30, 2011 at 12:15:25PM +0800, sunhux G wrote:
>    I'm trying to get yesterday's date in YYYYMMDD format.
>    Anyone know if RHES 4.x has GNU date that allows
>    yesterday=$(date -d "-1 day" '+%Y%m%d')
> 

Does this help?

$ yesterday=$(date -d "-1 day" '+%Y%m%d')
$ echo $yesterday
20110129
$ date
Sun Jan 30 07:10:59 SAST 2011
$ cat /etc/issue
CentOS release 4.8 (Final)
Kernel \r on an \m

$ date --version
date (coreutils) 5.2.1
Written by David MacKenzie.

Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ which date
/bin/date
$ rpm -qf /bin/date
coreutils-5.2.1-36.el4.centos
$ 

-- 
Hugo Lombard

--
Linux-cluster mailing list
Linux-cluster@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/linux-cluster


[Index of Archives]     [Corosync Cluster Engine]     [GFS]     [Linux Virtualization]     [Centos Virtualization]     [Centos]     [Linux RAID]     [Fedora Users]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Camping]

  Powered by Linux