How do I take out(remove) the date part in the file name in a script?

Hi All,

I need to create links between two directories.

have multiple files in a specified location.
Source Location ex: /opt/xdm/input/
Target Location ex: /opt/xdm
input file names: 1. abc_app.aus.apac.yyyymmdd.dtd
2. abcd_app.aus.apac.yyyymmdd.dtd
I need to build a code that reads all the files from the location and cuts the date part from the file name and creates a soft link in a target directory.

Expected links files:

  1. abc_app.aus.apac.dtd -- abc_app.aus.apac.yyyymmdd.dtd

There are separate dated directories for source and target and links will be created in those dated directories

can u help me out with the code?

Waiting for your reply!!!!!!!!!!!!!

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.