Skip to content

Instantly share code, notes, and snippets.

@kotobukid
Created September 23, 2012 17:52
Show Gist options
  • Save kotobukid/3772492 to your computer and use it in GitHub Desktop.
Save kotobukid/3772492 to your computer and use it in GitHub Desktop.
URLの書かれたリストから値を取得し連番としてダウンロードするスクリプト
#!/bin/bash
#http://www.kotokoi.org/2010/02/26/%E3%82%B7%E3%82%A7%E3%83%AB%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%81%A7%E3%82%BC%E3%83%AD%E5%9F%8B%E3%82%81%E3%81%84%E3%82%8D%E3%81%84%E3%82%8D%E3%80%82/
_count=0
while read line; do
_count=`expr $_count + 1`
val=$_count
for (( i = 0; i < $((4 - ${#val})); i++ ))
{
val=0${val}
}
wget -O "${val}" $line
done < $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment