title: Downloading site images through terminal using curl
body: <p>I'm trying to download a large batch of images from a website onto my Mac. I can download the smaller images with DownloadThemAll, SiteSucker, etc but they don't quite dig deep enough. So I've had to jump into Terminal which is a little bit out of my comfort zone and my skills are a bit rusty.</p>
  
  <p>I've had a try with the script below:</p>
  
  <pre><code>curl -O http://www.domain.co.uk/system/images/[1-1000]/original/*.jpg
  </code></pre>
  
  <p>This script works and I can see the Terminal downloading the image files however the issue I'm having is that the files are being overwritten with *.jpg and not producing them sequentially such as 1.jpg, 2.jpg, 3.jpg etc or even with their original names. The original jpg names use random numbers/letters (such as LIC0145_websource.jpg) which is why I've tried to supplement it with the *.jpg. I'm wondering which piece of code I'm missing to tell the Terminal to download these images.</p>
  
  <p>I've also tired calling the shell script below but run into the 'Unexpected end of file'</p>
  
  <pre><code>#!/bin/bash
  for i in `seq 1 1000`;
  do
  input=http://www.domain.co.uk/system/images/$i/original/*.jpg
  output=$i.jpg
  #   echo $input, $output
  curl --output $output --remote-name $input
  done
  </code></pre>
  
  <p>I think the curl option might still be a better option but if anyone has any fixes or other solutions let me know.</p>