# Config-translation does not handle ENV variables with spaces in them

**URL:** <https://discuss.circleci.com/t/config-translation-does-not-handle-env-variables-with-spaces-in-them/20472>\
**Category:** Bug Reports\
**Tags:** config-translation\
**Created:** [March 5, 2018, 3:40am UTC](https://discuss.circleci.com/t/config-translation-does-not-handle-env-variables-with-spaces-in-them/20472 "2018-03-05T03:40:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bunnymatic](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/bunnymatic/32/92_2.png) [@bunnymatic](https://discuss.circleci.com/u/bunnymatic)\
**Post date:** [March 5, 2018, 3:40am UTC](https://discuss.circleci.com/t/config-translation-does-not-handle-env-variables-with-spaces-in-them/20472/1 "2018-03-05T03:40:13Z")

</div>

Hi

I’ve been working to move to Circle 2. Just pulled the `config-translation` file which looked great. On the first run though I found that the environment variables are not quoted when they are re-written.

Thought it might be worth a report.

My old circle.yml had:

```auto
machine:
  environment:
    API_CONSUMER_KEY: Testing Testing 1 2

```

and when it got converted to Circle 2, I got

```auto
- run:
        working_directory: ~/my_project/dir
        command: echo -e "export API_CONSUMER_KEY=Testing Testing 1 2\nexport ..."

```

Which fails in the shell with an error:

```auto
/tmp/.bash_env-5a9cb170c9e77c00017a6dac-0-build: line 1: export: `1': not a valid identifier

```

It feels like the converter could be a tiny bit smarter and wrap those with quotes as needed.

I manually updated the line to read

```auto
 command: echo -e "export API_CONSUMER_KEY='Testing Testing 1 2'\nexport..."

```

and this got me rolling. But it might be nice if that was a bit smoother for folks.

Cheers  
Jon

---

<div class="post-metadata">

**Author:** ![ndintenfass](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/ndintenfass/32/156_2.png) [@ndintenfass](https://discuss.circleci.com/u/ndintenfass)\
**Post date:** [March 5, 2018, 10:16pm UTC](https://discuss.circleci.com/t/config-translation-does-not-handle-env-variables-with-spaces-in-them/20472/2 "2018-03-05T22:16:35Z")

</div>

Thanks - I’ve filed a bug internally, and we’ll take a look soon.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:35am UTC](https://discuss.circleci.com/t/config-translation-does-not-handle-env-variables-with-spaces-in-them/20472/3 "2018-06-18T11:35:32Z")

</div>

Closed on June 18, 2018, 11:35am UTC


