У меня есть несколько URL в файле, подобном этому:
https://private/report-artifact/dsop-pipeline-artifacts/container-scan-reports/anchore/enterprise/enterprise/0.6.1/2020-02-08T004236.092_2801/enterprise-0.6.1.tar
https://private/report-artifact/dsop-pipeline-artifacts/container-scan-reports/atlassian/bamboo-data-center/bamboo-agent/6.10.4/2019-12-17T185400.126_2118/bambo.tar
...
Я хочу, чтобы они сортировались по AZ согласно последнему значению , ie:
https://private/report-artifact/dsop-pipeline-artifacts/container-scan-reports/atlassian/bamboo-data-center/bamboo-agent/6.10.4/2019-12-17T185400.126_2118/bambo.tar
https://private/report-artifact/dsop-pipeline-artifacts/container-scan-reports/anchore/enterprise/enterprise/0.6.1/2020-02-08T004236.092_2801/enterprise-0.6.1.tar
...
Я могу получить значение sed
последнего параметра с помощью sed 's|.*/||'
, что дает мне шаблон AZ, который я ищу:
bambo.tar
enterprise-0.6.1.tar
Но не уверен, как я могу "отсортировать "вся строка URL, как я хочу?