Re: [newbie] Creating a directory

2003-07-19 Thread Eric Huff
  That didn't work for me.  I did figure it out by doing:
 
 [EMAIL PROTECTED] todd]$ datedir=`date +%Y%m%d%H%M%S`;
 [EMAIL PROTECTED] todd]$ echo tomcat$datedir
 tomcat20030718215657
 
 You are using the backticks (the shift+tilde) and not the single
 quote? Using bash?

Works here, too.  (on my keyboard, though, no shift, just the (` or ~)
key

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


Re: [newbie] Creating a directory

2003-07-19 Thread Todd Slater
On Fri, 18 Jul 2003 22:59:53 -0700
Eric Huff [EMAIL PROTECTED] wrote:

   That didn't work for me.  I did figure it out by doing:
  
  [EMAIL PROTECTED] todd]$ datedir=`date +%Y%m%d%H%M%S`;
  [EMAIL PROTECTED] todd]$ echo tomcat$datedir
  tomcat20030718215657
  
  You are using the backticks (the shift+tilde) and not the single
  quote? Using bash?
 
 Works here, too.  (on my keyboard, though, no shift, just the (` or ~)
 key

Yeah, here too :) The tilde requires a shift, not the backtick.

Todd

-- 
Name that tune #2: Turn up the Eagles the neighbors are listening.

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


[newbie] Creating a directory

2003-07-18 Thread Troy Davidson
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

But, all I get is /tomcat.  I do a echo $datedir and it's empty.  The reason
it's empty is the space between the '=' and the command 'date'.

So, I try:

datedir=date +%Y%m%d%H%M%S

but I get an error saying that it can't find command '+%Y%m%d%H%M%S'.  I try
putting it all in quotes, but that just echos out the command again like
it's a string:

datedir=date +%Y%m%d%H%M%S or datedir='date +%Y%m%d%H%M%S'
echo $datedir
date +%Y%m%d%H%M%S

So, I tried this:

date +%Y%m%d%H%M%S | mkdir

and that failed.  So did:

date +%Y%m%d%H%M%S  time.text
mkdir  cat time.text

and:

date +%Y%m%d%H%M%S  time.text
mkdir  time.text

How would I go about capturing the datetime stamp and then using that to
create a directory?

Thanks for the help.

Troy Davidson 
Linux User #311107

++ 
Follow the adventures of a 
real life computer and 
  gaming nerd! 

   www.clandaith.com 
++ 

** This messages was composed on a 100% Microsoft free computer **




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


Re: [newbie] Creating a directory

2003-07-18 Thread Todd Slater
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


Re: [newbie] Creating a directory

2003-07-18 Thread Troy Davidson
That didn't work for me.  I did figure it out by doing:

datedir=$(date +%Y%m%d%H%M%S)
echo $datedir
20030717161622

Thanks for the help though.


Troy Davidson 
Linux User #311107

++ 
Follow the adventures of a 
real life computer and 
  gaming nerd! 

   www.clandaith.com 
++ 

** This messages was composed on a 100% Microsoft free computer **


Quoting Todd Slater [EMAIL PROTECTED]:

 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