On 05 Feb 2002 13:16:56 -0700 Robert Goshko <[EMAIL PROTECTED]> wrote:

> 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.

#!/bin/bash
curdttm=`date +%Y%m%d-%H%M`
echo $curdttm

gives:  20020205-1536

Using bash, no spaces around "=" and no "$" on assignment.

HTH,
Pierre

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

Reply via email to