title: Passing arguments to octave function from within bash script
body: <p>I wrote a function in Octave that takes in a line read from a file (one line at a time) as input argument. I use a bash script to read a line at a time from the file and then pass that as argument to the octave function from within the script.  </p>
  
  <p>My bash script looks like so:  </p>
  
  <pre><code>#!/bin/bash  
  
  while read line
  do
    octave --silent --eval 'myOctaveFunc("${line}")'
  done &lt; "inFileName"
  </code></pre>
  
  <p>When I execute above script, octave throws errors like:  </p>
  
  <pre><code>error: called from:
  error:   /usr/share/octave/3.2.3/m/miscellaneous/fullfile.m at line 43, column 11
  error: evaluating argument list element number 2
  error: evaluating argument list element number 1
  error:   /usr/libexec/octave/packages/gsl-1.0.8/i386-redhat-linux-gnu-api-v37/PKG_ADD at line 47, column 1
  error: addpath: expecting all args to be character strings
  error: addpath: expecting all args to be character strings
  error: addpath: expecting all args to be character strings
  error: addpath: expecting all args to be character strings
  </code></pre>
  
  <p>and so on.. </p>
  
  <p>I have been able to run the octave script <code>myOctaveFunc.m</code> with input arguments such as <code>helloWorld</code> from the command line. The problem arises when I try to run it from within the bash script.  </p>
  
  <p>My questions are:<br>
  1. How do I get the octave function running from within the bash script?<br>
  2. I am using <code>gvim</code> to edit the bash script. When I type in the line to invoke the octave script, I see that the <code>${line}</code> is colored differently as compared to normal circumstances. Is that because of the <code>''</code> used to invoke the octave function? If so, should I be worried about it?  </p>