Skip to content

Conversation

molo1134
Copy link

@molo1134 molo1134 commented Nov 4, 2021

No description provided.

Copy link
Owner

@QueuingKoala QueuingKoala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a small tweak, this looks good; see inline comments.


al_type="${fn#*_}"
al_type="${al_type%%_*}"
al_type="${al_type%%.info}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch on the suffix removal.

Could this be changed to either shortest-trailing, %.info or longest-trailing %%.* instead? A non-glob string won't benefit from longest-match. Between the above options, a glob makes it easier for alternative suffixes to be used in the future (like .info.txt) but may impair meaning as this is already hard-coded elsewhere. Either works for me as more direct, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants