Tags: 5halloi, bash, command, date, format, linux, parameters, program, programming, provide, sco, server, unix, yesturday

SCO bash command (DATE) "yesturday"

On Programmer » Unix & Linux

3,218 words with 5 Comments; publish: Tue, 29 Apr 2008 18:31:00 GMT; (20060.55, « »)

SCO Open Server 5.0.5

Hallo!

I have to use the bash command to provide parameters for program.

My problem is that I have to use date.

To get format "DDMMYY" I use the following command:

DATE=`date '+%y%m%d'`

Everything is ok. The script work correctly ($DATE).

The problem is that I have to get date for yesterday.

But the format has to be the same.

I haven't got PHP or Perl language (was be easy),

And I can not to install.

I have looked to the man for the date command and for same bash command with

out good result.

Maybe somebody know haw to easy provide the date for yesterday (DDMMYY) usin

g bash commands. Or

maybe somebody can write me where I can find solution.

P.s. Sorry, I am not UNIX specialist. I am beginner.

Pozdrawiam/ Best Regards

Maniek

All Comments

Leave a comment...

  • 5 Comments
    • _.-In comp.unix.shell, Maniek wrote the following -._

      > The problem is that I have to get date for yesterday.

      The FAQ for this newsgroup covers how to do that.

      General rull, if you think that there is any chance in the world that

      you are not the first person to ask something then look it up before

      asking. It is faster than waiting for a response. In this case a

      google or deja search for "date yesterday sh" would have worked just

      fine.

      .-')) http://asciipr0n.com/fp ('-. | It's a damn poor mind that

      ' ..- .:" ) ( ":. -.. ' | can only think of one way to

      ((,,_;'.;' UIN=66618055 ';. ';_,,)) | spell a word.

      ((_.YIM=Faux_Pseudo :._)) | - Andrew Jackson

      #1; Tue, 29 Apr 2008 18:32:00 GMT
    • See question 6 of the FAQ

      http://home.comcast.net/~j.p.h/cus-faq

      See also

      http://groups.google.com/groups?selm=slrnbvnhu2.3v.stephane.chazelas%40spam.

      is.invalid

      for arbitrary date calculation in shell.

      Stephane

      #2; Tue, 29 Apr 2008 18:33:00 GMT
    • "Faux_Pseudo" Wrote :

      [.....FAQ....google......It is faster than waiting for a response.....]

      You are completly right....

      Thank you

      Maniek

      #3; Tue, 29 Apr 2008 18:34:00 GMT
    • "Stephane CHAZELAS" wrote:

      [....]

      Thank you.

      Best Regards

      Maniek

      #4; Tue, 29 Apr 2008 18:35:00 GMT
    • On Fri, 25 Jun 2004 14:18:54 +0200, "Maniek" <foxbitSPAM.unix-linux.todaysummary.com.inetia.pl>

      wrote:

      >SCO Open Server 5.0.5

      >Hallo!

      >I have to use the bash command to provide parameters for program.

      >My problem is that I have to use date.

      >To get format "DDMMYY" I use the following command:

      >DATE=`date '+%y%m%d'`

      >Everything is ok. The script work correctly ($DATE).

      >The problem is that I have to get date for yesterday.

      >But the format has to be the same.

      >I haven't got PHP or Perl language (was be easy),

      >And I can not to install.

      >I have looked to the man for the date command and for same bash command wit

      hout good result.

      >Maybe somebody know haw to easy provide the date for yesterday (DDMMYY) usi

      ng bash commands. Or

      >maybe somebody can write me where I can find solution.

      >P.s. Sorry, I am not UNIX specialist. I am beginner.

      Couple of links for you:

      http://aplawrence.com/Unix/yesterday.html

      http://tinyurl.com/2ozoj

      Scott McMillan

      #5; Tue, 29 Apr 2008 18:36:00 GMT