[lug] bash script newbie

Hugh Brown hugh at vecna.com
Tue Oct 30 11:11:34 MST 2001


cp oldfile "oldfile.`date +"%m-%d-%Y %r %Z"`"

the %x creates 10/30/2001 and makes it look like you have a directory
structure when you don't.

Play around with the above.

Hugh


"Jason Davis"
> 
> so im trying to rename a file with the current date
> hers my go at it ...doesnt work..
> 
> #! /bin/bash
> NAME=$(date +"%x %r %Z")
> echo $NAME
> cat /home/taproot/htmtest > /home/taproot/$NAME
> 
> 
> please help
> thanks
> jd
> 



More information about the LUG mailing list