![]() |
|
|
|
|
|||||||
| 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 |
| To convert multi format file to a readable ascii format | gaur.deepti | UNIX for Dummies Questions & Answers | 5 | 03-25-2008 12:03 PM |
| date issue-find prevoius date in a patricular format | bsandeep_80 | UNIX for Advanced & Expert Users | 3 | 11-15-2007 05:42 PM |
| convert mmddyy date format to ccyyddd format?? | Bhups | Shell Programming and Scripting | 2 | 09-27-2006 08:30 PM |
| file date format | ludenso | UNIX for Advanced & Expert Users | 4 | 04-30-2006 06:01 AM |
| Converting the File Creation Date to a new format | barney_clough | UNIX for Dummies Questions & Answers | 1 | 06-12-2002 04:43 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I need to copy a file from one directory to another and need to add the current date at the end of my file in the new dir. Please provide me the cmd that I can use. I have a file abc.dat in dir SD/Files. I need to copy this file to dir SD/Files/Latest and the file name should have date with current time stamp at the end like abc.dat_10/07/2005 12:30:22. Thanks, Sarath. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
file_name="abc.dat_"
YYYYMMDDTIME="`date '+%d/%m/%Y %H:%M:%S'`" file_name=${file_name}_${YYYYMMDDTIME} echo $file_name |
|
#3
|
|||
|
|||
|
Hi Akrithi,
I am new to scripts.. I ran the PERL script that you gave me.. my $src_file_name="/dba58/d039/powerdev/staging/Devl/SrcFiles/CRMPS01/receivables/crmps_dly_recv_file_detail.dat" ; my $tgt_file_name="/dba58/d039/powerdev/staging/Devl/SrcFiles/CRMPS01/receivables/TEMP"; my $YYYYMMDDTIME="`date '+%d/%m/%Y %H:%M:%S'`" ; file_name=${tgt_file_name}_${YYYYMMDDTIME}; #echo $file_name cp src_file_name file_name; I got errors when I ran this.. Script name : script_copy.pl [/dba58/d039/powerdev/staging/Devl/Scripts/CRMPS01]>perl script_copy.pl Bareword found where operator expected at script_copy.pl line 4, near "${tgt_fil e_name}_" (Missing operator before _?) syntax error at script_copy.pl line 4, near "${tgt_file_name}_" Execution of script_copy.pl aborted due to compilation errors. [/dba58/d039/powerdev/staging/Devl/Scripts/CRMPS01]> Can u tell me how to resolve this..? |
|
#4
|
|||
|
|||
|
It's a shell script, not a PERL script.
|
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|