[BASH] Need help with bash scripts for my project

Hello. I search some help with some autonation scripts for my project. Unfortunatellt, some problems with them are too difficult for me to solve them alone. Bellow I list some of them (some points are listed as pseudo-code for easier presentation):

  1. make a function with:

Part 1a:

  • has variables (can be as array) with a user given url addressess (for example: gnu_url=“https://ftp.gnu.org/gnu/”, etc.)

  • has variable array of program names and assigned url variable (for example:
    gnu -> [ app1, app2, etc.]

  • example: [autoconf, automake] -> gnu_url

In result should be that when the script reads the app name then it will “know” that this app is under given address and save this location (with app name) into a temporary variable

  • example: autoconf => $gnu_url/autoconf *(in result: autoconf => ftp.gnu.org/gnu/autoconf/)

  • unset not needed anymore variables to free memory

Part 1b:

when the script “know” where search this app, it should read this address and then:

  • read the folder’s content and save it into a variable
  • extract the app version and compare with one has the highest value and list the archive files (zip, tar.gz, tgz, bz2, 7z, tar.xz, etc.), allowing user to selct one
  • download the selected file

If you share what you’ve done so far and are specific about where you’re having troubles, someone might be able to help you.

I’m on the project start. The only thing I have for now are a manual and list of files with are required to become downloaded to make the project work start