title: How to use variables on qsub?
body: <p>I'm new to qsub and I'm trying to figure out how to use the task queue optimally. I have this script that works well:</p>
  <pre class="lang-sh prettyprint-override"><code>#!bin/bash
  
  ##PBS -V  # Export all environment variables from the qsub command environment to the batch job.
  #PBS -N run
  #PBS -q normal.q 
  #PBS -e archivo.err
  #PBS -o archivo.out
  #PBS -pe mpirun 8
  #PBS -d ~/ # Working directory (PBS_O_WORKDIR)
  #PBS -l nodes=1:ppn=8    
  
  ~/brinicle/step-2/onephase_3/./main.x --mesh ~/brinicle/step-2/onephase_3/results/mesh.msh -Rmin 0 -Rmax 10 -Zmin 0 -Zmax 10 -o 2 -r 2 -T_f -10 -a_l 7.8 -a_s 70.8 -dt 0.01 -t_f 1 -v_s 10 -ode 12 -reltol 0.00001 -abstol 0.00001
  </code></pre>
  <p>The problem, as you can see, is that the command line is huge and hard to edit from the command shell. I would want to separate it into variables such as</p>
  <pre><code>#MESH=&quot;--mesh ~/brinicle/step-2/onephase_3/results/mesh.msh&quot;
  #EXE=&quot;~/brinicle/step-2/onephase_3/./main.x&quot;
  .
  .
  .
  $EXE $MESH $PARAMETERS
  </code></pre>
  <p>And for the other parameters too.</p>
  <p>But when I do this the program doesn't run and says that there's an illegal variable or that the variable is undefined. Also, is very important to me to change easily the parameters <code>-o</code>, <code>-r</code>, <code>-ode</code> and send multiple jobs at once. For example 5 equal jobs with <code>-o 1</code> then 5 with <code>-0 2</code> and so on. I want to be also able to modify in this way <code>-r</code> and <code>-ode</code>. The problem is that without using the variables I really don't know how to do that.</p>
  <p>Please, if someone can tell me how to automate the script in this way would be a huge help.</p>