wgetなどのユーティリティをダウンロードするためのURLを1行にまとめます。

wgetなどのユーティリティをダウンロードするためのURLを1行にまとめます。

次のwgetコードを検討してください。

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

上記と同じ基本URLを持つ複数の端末を2つ以上ではない1行に統合するエレガントな方法はありますか?

擬似コード:

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

ベストアンサー1

複数のURLが一度に許可されるため、中wgetかっこ拡張を使用してこれを実行できますbash

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

(でも

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

しかし、もちろん、これは非常に適切な名前でのみ機能します。

おすすめ記事