title: Bash value in array
body: <p>I have the following</p>
  
  <pre><code>#!/bin/bash
  aprograms=`pgrep a`
  echo $aprograms
  </code></pre>
  
  <p>which outputs:</p>
  
  <pre><code>alejandro@ubuntu:~$ bash test.sh 
  2 6 7 8 12 13 16 17 20 27 ...
  </code></pre>
  
  <p>I want to control if there is a value inside $aprograms.
  I tryed the following (Which I dont know if its even a valid approach):</p>
  
  <pre><code>if [ $value in $aprograms ];then
      echo "found"
  </code></pre>
  
  <p>But doesnt work. Is there a correct way to control if there is a value is inside $aprograms?</p>