title: Check if conda env exists and create if not in bash
body: <p>I have a build script to run a simple python app. I am trying to set it up that it will run for any user that has conda installed and in their PATH. No other prerequisites. I have that pretty much accomplished but would like to make it more efficient for returning users.</p>
  <p>build_run.sh</p>
  <pre><code>conda init bash
  conda env create --name RUN_ENV --file ../run_env.yml -q --force
  conda activate RUN_ENV
  python run_app.py
  conda deactivate
  </code></pre>
  <p>I would like to make it that the script checks if RUN_ENV already exists and activates it instead of forcing its creation every time. I tried</p>
  <pre><code>ENVS=$(conda env list | awk '{print }' )
  if [[ conda env list = *&quot;RUN_ENV&quot;* ]]; then
     conda activate RUN_ENV
  else 
     conda env create --name RUN_ENV --file ../run_env.yml -q
     conda activate RUN_ENV
     exit
  fi;
  python run_app.py
  conda deactivate
  </code></pre>
  <p>but it always came back as false and tried to create RUN_ENV</p>