Script - Search by part name and extension
by orangepeel190 from LinuxQuestions.org on (#55J02)
Hi!
I am trying to draft up a script to search a website for a file name that changes week to week.
The file names extension is .mp3 (Simple!)
One part of the file name does not change (again - simple)
The part that is testing is the file name is uploaded in different format each week. Some times is:
#FILE="`date -dsunday +'%d-%m-%Y'`-xxx_news.mp3"
#FILE="`date -dsunday +'%d-%m-%Y'`_xxx_news_64.mp3"
#FILE="`date -dsunday +'%d%m%Y'`_xxx_news_64.mp3"
#FILE="`date -dsunday +'%d%m%Y'`-xxx_news_64.mp3"
#FILE="xxx_news_64-`date -dsunday +'%d-%m-%Y'`.mp3"
#FILE="xxx_news_32-`date -dsunday +'%d-%m-%Y'`.mp3"
#FILE="xxx_news_64_`date -dsunday +'%d-%m-%Y'`.mp3"
#FILE="xxx_news_32_`date -dsunday +'%d-%m-%Y'`.mp3"
#FILE="xxx_news_64-`date -dsunday +'%d%m%Y'`.mp3"
#FILE="xxx_news_64_`date -dsunday +'%d%m%Y'`.mp3"
As you can see, there are some parts of the file name on the website that remain constant - yet some (inc the date string) changes.....
I am seeking assistance in drafting up a line fo the download script to be able to find the *news*.mp3 file on the website and download it to my system - where it will cp/mv the file to a dedicated location and save it under a "known" filename.
Thoughts/comments/suggestions?
Thank you


I am trying to draft up a script to search a website for a file name that changes week to week.
The file names extension is .mp3 (Simple!)
One part of the file name does not change (again - simple)
The part that is testing is the file name is uploaded in different format each week. Some times is:
#FILE="`date -dsunday +'%d-%m-%Y'`-xxx_news.mp3"
#FILE="`date -dsunday +'%d-%m-%Y'`_xxx_news_64.mp3"
#FILE="`date -dsunday +'%d%m%Y'`_xxx_news_64.mp3"
#FILE="`date -dsunday +'%d%m%Y'`-xxx_news_64.mp3"
#FILE="xxx_news_64-`date -dsunday +'%d-%m-%Y'`.mp3"
#FILE="xxx_news_32-`date -dsunday +'%d-%m-%Y'`.mp3"
#FILE="xxx_news_64_`date -dsunday +'%d-%m-%Y'`.mp3"
#FILE="xxx_news_32_`date -dsunday +'%d-%m-%Y'`.mp3"
#FILE="xxx_news_64-`date -dsunday +'%d%m%Y'`.mp3"
#FILE="xxx_news_64_`date -dsunday +'%d%m%Y'`.mp3"
As you can see, there are some parts of the file name on the website that remain constant - yet some (inc the date string) changes.....
I am seeking assistance in drafting up a line fo the download script to be able to find the *news*.mp3 file on the website and download it to my system - where it will cp/mv the file to a dedicated location and save it under a "known" filename.
Thoughts/comments/suggestions?
Thank you