Repository: conda/conda

Issue:
Incorrect use of csh setenv in conda init
<!--
Hi!  Read this; it's important.

This is an issue tracker for conda -- the package manager.  File feature requests
for conda here, as well as bug reports about something conda has messed up.

If your issue is a bug report for:
  * a specific conda package from Anaconda ('defaults' channel):
      ==> file at https://github.com/ContinuumIO/anaconda-issues
  * a specific conda package from conda-forge:
      ==> file at the corresponding feedstock under https://github.com/conda-forge
  * repo.anaconda.com access and service:
      ==> file at https://github.com/ContinuumIO/anaconda-issues
  * anaconda.org access and service:
      ==> file at https://anaconda.org/contact/report
  * commands under 'conda build':
      ==> file at https://github.com/conda/conda-build
  * commands under 'conda env':
      ==> please file it here!
  * all other conda commands that start with 'conda':
      ==> please file it here!

If you continue on,

   **please include all requested information below.**

If a maintainer determines the information is required to understand 
your issue, and if it is not provided, your issue may be
closed automatically.

-->

## Current Behavior
<!-- What actually happens?
     If you want to include console output, please use "Steps to Reproduce" below. -->

The following was appended to `~/.tcshrc` (`...` indicates the path to conda):

```
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
if ( -f ".../etc/profile.d/conda.csh" ) then
    source ".../etc/profile.d/conda.csh"
else
    setenv PATH=".../bin:$PATH"
endif
# <<< conda initialize <<<
```

The responsible line is here: https://github.com/conda/conda/blob/master/conda/core/initialize.py#L1236

### Steps to Reproduce
<!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce.
     Include the exact conda commands that reproduce the issue and their output between the ticks below. -->
```
conda init tcsh
```


## Expected Behavior
<!-- What do you think should happen? -->

`setenv PATH=` is incorrect. A space should be used instead of an equal sign. Logging in on a system where `conda.csh` doesn't exist produces this error message:

```
setenv: Variable name must contain alphanumeric characters.
```

## Environment Information
<details open><summary><code>`conda info`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda info' -->

```
     active environment : None
            shell level : 0
       user config file : /home/andreasg/.condarc
 populated config files : 
          conda version : 4.7.12
    conda-build version : not installed
         python version : 3.6.7.final.0
       virtual packages : __cuda=10.2
       base environment : /opt/jupyterhub/miniconda3  (read only)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/jupyterhub/miniconda3/pkgs
                          /home/andreasg/.conda/pkgs
       envs directories : /home/andreasg/.conda/envs
                          /opt/jupyterhub/miniconda3/envs
               platform : linux-64
             user-agent : conda/4.7.12 requests/2.22.0 CPython/3.6.7 Linux/4.15.0-60-generic ubuntu/18.04.3 glibc/2.27
                UID:GID : 10094:10000
             netrc file : None
           offline mode : False
```
</p></details>


<details open><summary><code>`conda config --show-sources`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda config --show-sources' -->

```

```
</p></details>


<details><summary><code>`conda list --show-channel-urls`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda list --show-channel-urls' -->

```

```
</p></details>



Discussion:
@andreasg123 thanks for the detailed description and solution! Since you've done most of the work already you are more than welcome to submit a PR to fix the problem. This is probably the fastest way to get your fix in, and also you'll get more visible credit for your work. If you are too swamped to submit a PR, that's fine too, we'll get to it eventually, though no promises about when eventually is :/ 

Resolving patch:
diff --git a/conda/core/initialize.py b/conda/core/initialize.py
--- a/conda/core/initialize.py
+++ b/conda/core/initialize.py
@@ -1233,7 +1233,7 @@ def _bashrc_content(conda_prefix, shell):
             if ( -f "%(conda_prefix)s/etc/profile.d/conda.csh" ) then
                 source "%(conda_prefix)s/etc/profile.d/conda.csh"
             else
-                setenv PATH="%(conda_bin)s:$PATH"
+                setenv PATH "%(conda_bin)s:$PATH"
             endif
             # <<< conda initialize <<<
             """) % {


Test patch: