October 16th, 2012, 03:32 PM
Renaming a file when I only know part of the filename
I am a UNIX newbie. I need help renaming a file when I only know part of the filename. I know the file will look like:
I get a copy of the report each day with the timestamp of when the file was created. I know it is created each day, but the timestamp can vary. I want to FTP the file to another directory and remove the timestamp portion so the resulting file would look like
I tried setting up some variables for date, but when I try to use them I get
My_report_date not found instead of it translating to the variable I setup as
October 16th, 2012, 04:58 PM
What about something like
mv /source/folder/My_report* /new/folder/My_report_$STAMP.csv
"For if leisure and security were enjoyed by all alike, the great mass of human beings who are normally stupefied by poverty would become literate and would learn to think for themselves; and when once they had done this, they would sooner or later realise that the privileged minority had no function and they would sweep it away"
- George Orwell, 1984
October 17th, 2012, 03:41 PM
That worked. Thanks. With my prior attempt I was declaring my variable incorrectly (that's what I get for borrowing someone else's code).
Originally Posted by badger_fruit