title: How can I use 'head' in a bash script with a variable?
body: <p>I've been trying to create a script that can read a certain line off of a file given some variables I've created.</p>
  
  <pre><code>SCRIPTNUM=$(tail -1 leet.txt)
  LINE=$(echo $SCRIPTNUM | python leetSolver.py)
  PART1=$(head "-$LINE" leet.txt)
  FLAG=$(printf "$PART1" | tail -1)
  FLAGFORMAT="$FLAG\n"
  printf $FLAGFORMAT
  </code></pre>
  
  <p>From this the biggest problem I face is that I get this error:</p>
  
  <pre><code>head: invalid trailing option -- 
  Try `head --help' for more information.
  </code></pre>
  
  <p>The code works just fine when inputted through the terminal one line at a time.  Is there a way to make this code work?  It's worth noting that using a constant (ie head -5) works.</p>