![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Get date and time for past 1 hour from current date | spch2o | Shell Programming and Scripting | 5 | 08-29-2008 01:32 AM |
| Perl: Extracting date from file name and comparing with current date | MKNENI | Shell Programming and Scripting | 4 | 03-26-2008 01:01 PM |
| filename in current directory | calgone337 | Shell Programming and Scripting | 2 | 04-15-2007 11:21 AM |
| Append filename to datafile | Satyagiri | UNIX for Dummies Questions & Answers | 3 | 10-12-2006 06:19 AM |
| Append date to filename | hshapiro | UNIX for Dummies Questions & Answers | 5 | 04-03-2006 06:52 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
In C Shell programming I haven’t successfully been able to append the date in the format mmddyyyy to a filename. I’ve tried the following:
I can print out the date in the correct format: date +%x | sed ‘s/\///g I can create a variable with the filename: set newfile=changedfiles I can use the mv command: mv changedfiles.tar “$newfile” I cannot figure out how to append the current date to the file named in $newfile. Thanks |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
set newfile = "changedfiles`date +%m%d%Y` "
This would give you "changedfiles07192006" set into the variable newfile |
|
#3
|
|||
|
|||
|
Thanks that worked.
You helped me realize that there is a difference between the symbols ' and `. |
|
#4
|
|||
|
|||
|
` is used for command substitution.
|
|||
| Google The UNIX and Linux Forums |