Minor cleanups in script downloadinputs.sh
- avoid repetitions in the code (DRY principle)
- use wget instead of curl to give more feedback to the user.
- avoid a few bash warnings reported by shellcheck.
- avoid changing directory within the script, this is error prone.
The loop seems like a nice idea in theory, but in practice I am not sure it's good since wiktionary often does things very inconsistently and it's not sure the same logic will continue to work for all language variants. This applies even more so if one wanted a script version that does not always download the latest but a specific "stable" version. Apart from that I'd suggest to specify the language list directly in the "for" loop, to avoid an unnecessary bash-ism (the use of an array).
@rdoeffinger Thanks for checking and sorry for disappearing. I put the language list directly in the for loop as you suggested.
Regarding the use of the "for" loop: if a dictionary's language format change, it would require to update this file. But even in this case, with the loop, it would reduce code duplication. Unless all languages are different, but does it happen?
Let me know, and thanks again for the app and updates, I use it every day!
No worries, I won't ever blame anyone for contributing at their own pace. I'll accept it with the loop, at least for the moment it's an improvement. Though I wouldn't agree that it's as simple as "does it reduce code duplication". In exchange for reducing code duplication a loop does increase complexity, so some repetition can be better, especially when like here there's no risk of hidden bugs really. All the languages being different would happen if we'd have individual "stable" versions, but it doesn't make sense to consider that now. There is a little bit of a point that this piece of code might be used by non-programmers in order to generate dictionaries, and without a loop it would be more understandable for them. But as said overall I concluded I in the end agree with you that the loop is better to have.