|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
do you know if exists a bash metods/function to do today date -1 day or -2 day ecc? example (object style) today is 31102007, date.today(-1) = 30102007 Thanks |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 2007-10-31, Patrick <patrick.moresi@gmail.com> wrote:
> Hi, > do you know if exists a bash metods/function to do today date -1 day > or -2 day ecc? > example (object style) > today is 31102007, date.today(-1) = 30102007 > Thanks > The date command is not part of bash, but if you use bash, chances are that you have GNU date, and you can use the -d option, for example date -d yesterday Tue Oct 30 12:42:50 EDT 2007 date -d yesterday +%d%m%Y 30102007 "man date" or "info date" for more details. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On 31 Ott, 17:45, Bill Marcum <marcumb...@bellsouth.net> wrote:
> On 2007-10-31, Patrick <patrick.mor...@gmail.com> wrote:> Hi, > > do you know if exists a bash metods/function to do today date -1 day > > or -2 day ecc? > > example (object style) > > today is 31102007, date.today(-1) = 30102007 > > Thanks > > The date command is not part of bash, but if you use bash, chances are > that you have GNU date, and you can use the -d option, for example > date -d yesterday > Tue Oct 30 12:42:50 EDT 2007 > date -d yesterday +%d%m%Y > 30102007 > > "man date" or "info date" for more details. on solaris 10 it doesn't work... not exist "date -d" |
|
![]() |
| Outils de la discussion | |
|
|