Capturing an a filename that contains the month/date in filename ie fileMMDD

Capturing an a filename that contains the month/date in filename ie fileMMDD

Post by Christina Mille » Thu, 12 Aug 1999 04:00:00



I am trying to capture a filename that is named "fileMMDD" (MM=month,
DD=day).

Everyday this filename will be change to the current date. However, I need
to ftp this file to another server and when it is on the other server I have
to rename that file "fileMMDD.done" . I can do the ftp part and could do
this entire process only if I knew the exact name of the filename.

The directory that this file is located in will contain upto 30 other files
with the same file naming convention, but they will each a a differnt date,
ie. file0805, file0809, file0810, etc...

Any suggestions would be most appreciated.

 
 
 

Capturing an a filename that contains the month/date in filename ie fileMMDD

Post by Barry Margoli » Thu, 12 Aug 1999 04:00:00




>I am trying to capture a filename that is named "fileMMDD" (MM=month,
>DD=day).

>Everyday this filename will be change to the current date. However, I need
>to ftp this file to another server and when it is on the other server I have
>to rename that file "fileMMDD.done" . I can do the ftp part and could do
>this entire process only if I knew the exact name of the filename.

filename=`date +file%m%d`

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

1. renaming files from filename to filename-date

I am trying to come up with a one liner.  Doesn't really matter in which
shell I do it . . .

I am attempting to copy all of the files in one directory to their same
names but with a -MM_DD_YY appended.

for example, something like:

mv *.log *.`date '+%m_%d_%y'`

of course this doesn't work but if you have any suggestions I would love
to see them.  I know I've done this in the past but I just can't
remember how . . .

Thanks,
Diana

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Hard Drive Space Problem.

3. file of filenames, trying to execute %> cat filename

4. STREAMS Driver

5. How to change Windows-compliant filenames to Unix filenames

6. How to disconnect from a controlling tty?

7. Change Upper case filename to lower case filename

8. amusement of the day

9. replace filename with string in way that can fool apps that require a filename

10. a file of filenames compared to another file of filenames

11. command to display filenames for a particular month

12. Use find To Match Filenames That Contain Tabs

13. filename contains ":" characters in scp?