RE: storing todays date into a shell variable

From: Mulley, Nikhil (mnikhil_at_corp.untd.com)
Date: 12/16/04

  • Next message: Rino Mardo: "Re: storing todays date into a shell variable"
    Date: Thu, 16 Dec 2004 12:41:11 +0530
    To: "$Bill Luebkert" <dbecoll@adelphia.net>, "Mulley, Nikhil" <mnikhil@corp.untd.com>
    
    

    Yeah Bill, I do not want to reuse the TODAY variable external to the shell script, But what I want to say is When I echo $TODAY variable , it is not displaying the Data.
    myprompt$./storedate
    ./storedate: +%m/%d/%y: not found
    myprompt$

    ~Nikhil.

    -----Original Message-----
    From: $Bill Luebkert [mailto:dbecoll@adelphia.net]
    Sent: Thursday, December 16, 2004 12:37 PM
    To: Mulley, Nikhil
    Cc: redhat-list@redhat.com
    Subject: Re: storing todays date into a shell variable

    Mulley, Nikhil wrote:

    > Hi ,
    > I wanna have a shell script which puts the today's date into a shell
    > variable and later use the Shell Variable for other reasons,
    > I have been using like this..
    >
    > #!/bin/sh
    > TODAY=date '+%m/%d/%y'
    > echo $TODAY
    > Can any one tell me what could be wrong in this...

    Changing the date in your env will only change it for you and any child
    processes you create. Once your shell script exits, the TODAY will
    disappear for any new scripts run.

    -- 
      ,-/-  __      _  _         $Bill Luebkert    Mailto:dbecoll@adelphia.net
     (_/   /  )    // //       DBE Collectibles    Mailto:dbe@todbe.com
      / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
    -/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Rino Mardo: "Re: storing todays date into a shell variable"

    Relevant Pages