title: Bash unable to assign variable
body: <pre class="lang-sh prettyprint-override"><code>#!/usr/bin/env bash
  #SBATCH --partition=standard
  #SBATCH --nodes=1
  #SBATCH --ntasks=1
  #SBATCH --cpus-per-task=20
  #SBATCH --mem=100G
  USEAGE=&quot;metascript.sh &lt;wd&gt; &lt;wd1&gt;&quot;
  source ~/anaconda2/etc/profile.d/conda.sh
  conda activate assembly
  wd=$1
  wd1=$2
  cd $wd
  cd $wd1 
  for f in SRR*/ ; do
    [[ -e $f ]] || continue
    SRR=${f::-1}
    cd ../..
    jdid=$(sbatch -J FirstQC_$SRR ./pipelines/preprocessingbowtietrinity/FirstFastqc.sh $wd $wd1 $SRR)
    #echo ${jdid[0]}|grep -o '[0-9]\+'
    jobid=${jdid[0]}
    jobid1=${jobid[0]}|grep -o '[0-9]\+'
    #echo $jobid1
  </code></pre>
  <p>Hi all just having issues with my bash scripting, so I can print the line ${jdid[0]}|grep -o '[0-9]+' however when I assign it to a variable it is unable to return anything.</p>