Uniting urls for a download utility (like wget) in one line

command linecurldownloadwget

Consider these wget codes:

wget -P ~/ https://raw.githubusercontent.com/user/repo/branch/papj.sh
wget -P ~/ https://raw.githubusercontent.com/user/repo/branch/nixta.sh

Is there any elegant way to unite different terminals of the same basic URL as above, into one line instead 2 or more?

Pseudocode:

wget -P ~/ https://raw.githubusercontent.com/user/repo/branch/papj.sh||nixta.sh

Best Answer

As wget accepts several URLs at once this can be done using brace expansion in bash:

wget -P ~/ https://raw.githubusercontent.com/user/repo/branch/{papj.sh,nixta.sh}

(or even

wget -P ~/ https://raw.githubusercontent.com/user/repo/branch/{papj,nixta}.sh

but this only works for well-suited names of course).

Related Question