I have looked through several examples but I cannot find what I need. I am trying to dynamically assign the name of a file I am downloading to a variable so that I can refer to it later. I have to preserve the origin filename as this is hard-coded in the sha256 checksum file that I am subsequently using to validate the file integrity.
URL="https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&license_key=xxxxxxxxxxxx&suffix=zip"
curl -s -J "$URL"
obviously I cannot just go: filename=$(curl -s -J "$URL")
as that would just assign the file contents.
Any Pointers?