On Fri, Jul 18, 2003 at 11:43:05AM -0600, Troy Davidson wrote:
> I am trying to create a directory with a datetime stamp as part of the
> directory name.  This is for backup purposes so I know when a directory is
> backed up.
> 
> This is what I am trying to do on the commandline:
> 
> datedir= date +%Y%m%d%H%M%S
> mkdir /tomcat$datedir

"date" is a command, so if you want to assign its results to a variable
you need to use the backticks (`). So, you'd have:

datedir=`date +%Y%m%d%H%M%S`
mkdir /tomcat$datedir

I wasn't sure if you wanted that to be a folder inside /tomcat, or if
you want all folders to begin with tomcat. If the former, then don't
forget the slash, i.e. "mkdir /tomcat/$datedir"

HTH,

Todd

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

Reply via email to