need help passing date to variable

need help passing date to variable

Post by hummb.. » Sun, 14 May 2000 04:00:00



Hi,
I'm trying to pass the current month and day to a variable for puposes
of renaming and archiving files. Here's the basic idea;

#!/bin/sh
v_date= date +%m%d
mv file "file$v_date"

I've tried various combinations of single and double quotes on both
lines with no success. Any help is greatly appreciated. Thanks in
advance,
Larry

 
 
 

need help passing date to variable

Post by John » Sun, 14 May 2000 04:00:00


try v_date=`date +%m%d`

>Hi,
>I'm trying to pass the current month and day to a variable for puposes
>of renaming and archiving files. Here's the basic idea;

>#!/bin/sh
>v_date= date +%m%d
>mv file "file$v_date"

>I've tried various combinations of single and double quotes on both
>lines with no success. Any help is greatly appreciated. Thanks in
>advance,
>Larry


 
 
 

1. passing a variable to the `date` command

Is there a way to pass a variable to the `date` function or another
function that would return a specific value based upon the format I
request?

Ex.
     If I pass "8" I would want the function to return "Aug" for August
     If I pass "09072000" I want `Thursday` returned.

so on and so forth.

Gary Sperano

Sent via Deja.com http://www.deja.com/
Before you buy.

2. I need a flush

3. CSH: passing "date" 's output to a @ variable.

4. Large volume optical jukebox management

5. Awk question - need to pass a variable.

6. XF86Config and Medion MD9888

7. Help!! How to Pass Variables to my cgi...

8. only small mail files get through at new ISP using Red Hat 4 and netscape 3

9. help building kernel: help need to pass module specifuc parameters to scsi card

10. ksh: Need to read variables into variables

11. Needed: a variable who's name is controlled by a variable

12. Need help not passing make vars as env vars in gmake.

13. Help Needed with passing argument during bootup