Just to add my little grain of salt here, as a habit, you might want to put 
double quotes for the date argument. I had problems sometimes when they were 
not there.
    curdttm=`date "+%Y%m%d-%H%M"`

If you will put that script under SCCS control, then you would be better to 
do this instead:
    H="%H"
    m="%m"
    curdttm=`date "+%Y$m%d-$H%M"`
    unset H m

Otherwise, the %Y% and %H% are seen as keyword (see "man get"). Of course, 
other tools for source code control exist which may not have this problem.

On Tuesday 05 February 2002 18:55, jipe wrote:
> Le Mercredi 6 F�vrier 2002 00:44, vous avez �crit :
> > Le Mardi 5 F�vrier 2002 21:16, vous avez �crit :
> > > I have a line from one of my shell scripts to load the current date and
> > > time into a variable:
> > >
> > >      $curdttm = 'echo $blank |date +%Y%m%d-%H%M'
> > >
> > > I have used this on both AIX and HP-UX and it has worked great.
> > >
> > > Doesn't do diddly on my Linux box but set the $curdttm variable to a
> > > value of $'echo $blank |date +%Y%m%d-%H%M'.
> > >
> > > I know someone out there will have another way to do this.
> > >
> > > Thanks.
> >
> > $ curdttm=$(date +%Y%m%d-%H%M)
> >
> > gives for me:
> > $ echo curdttm
> > 20020206-0041
> >
> > bye
> > jipe
>
> sorry! was:
> $ echo $curdttm
> but it was late.... ;)

-- 
Gerard Perreault
[EMAIL PROTECTED]

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to