title: Using a BASH integer variable in an awk command
body: <p>I'm trying to run a command on every entry in a line of text:</p>
  
  <pre><code>#! /bin/bash
  
  range=$(ls -s /home/user/Pictures/Wallpapers | wc -l)
  
  for (( i=0; i&lt;$range; i++ ))
  do  
     d=$(ls /home/user/Pictures/Wallpapers | paste -sd " " | awk -F' ' '{ print $i }')
  echo $d
  done
  </code></pre>
  
  <p>But when I run it, it simply prints out the entire line of file entries with every iteration of the loop. I think it's because the "i" is not being interpreted since it's technically in between single quotes, and I can't figure out how to prevent it from doing this.</p>
  
  <p>Thanks.</p>