Skip to content

Instantly share code, notes, and snippets.

@yukpiz
Created September 2, 2015 07:21
Show Gist options
  • Save yukpiz/65964e12c342afc8b2d0 to your computer and use it in GitHub Desktop.
Save yukpiz/65964e12c342afc8b2d0 to your computer and use it in GitHub Desktop.

URLリストを読んでwgetする

いざ

$ vim download.list
+ http://xxxxxxxxxxxxxxx
+ http://xxxxxxxxxxxxxxx
+ http://xxxxxxxxxxxxxxx
+ http://xxxxxxxxxxxxxxx
+ http://xxxxxxxxxxxxxxx

$ cat download.list | while read line; do wget ${line}; done;

解説

あるファイルを1行ずつ読み込んで処理させたい場合while read lineを使う。
doの後で${line}には各行の文字列が格納されているので、
あとは処理に合わせてコマンドを実行するだけ。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment