title: Reading user-input in the same line as the script execution
body: <p>I have a BASH script named fib.sh. The script reads a user input (number) and performs a calculation. I want to be able to type</p>
  
  <pre><code>$ ./fib.sh 8
  </code></pre>
  
  <p>where 8 is the input</p>
  
  <p>Currently, I have to wait for the next line to enter the input.</p>
  
  <pre><code>$ ./fib.sh 
  $ 8
  </code></pre>
  
  <p>Script</p>
  
  <pre><code>#!/bin/bash
  
  read n
  
  a=0
  b=1
  count=1
  fib=$a
  
  while [ $count -lt $n ]; 
  do
      fib=$[$a+$b]
      a=$b
      b=$fib
      count=$[$count+1]
  done
  
  echo "fib $n = $fib"
  
  exit 0
  </code></pre>