title: Shell Script working with multiple files
body: <p>I have this code below:</p>
  
  <pre><code>#!/bin/bash
  
  filename=$1
  file_extension=$( echo $1 | cut -d. -f2 )
  directory=${filename%.*}
  
  if [[ -z $filename ]]; then
      echo "You forgot to include the file name, like this:"
      echo "./convert-pdf.sh my_document.pdf"
  else
      if [[ $file_extension = 'pdf' ]]; then
          [[ ! -d $directory ]] &amp;&amp; mkdir $directory
          convert $filename -density 300 $directory/page_%04d.jpg
      else
          echo "ERROR! You must use ONLY PDF files!"
      fi
  fi
  </code></pre>
  
  <p>And it is working perfectly well!</p>
  
  <p>I would like to create a script which I can do something like this: ./script.sh *.pdf</p>
  
  <p>How can I do it? Using asterisk.</p>
  
  <p>Thank you for your time!</p>