# $CYLC\_VERSION stripping '-1' suffix at runtime

**URL:** <https://cylc.discourse.group/t/cylc-version-stripping-1-suffix-at-runtime/1360>\
**Category:** Cylc Support\
**Created:** [October 28, 2026, 1:56pm UTC](https://cylc.discourse.group/t/cylc-version-stripping-1-suffix-at-runtime/1360 "2026-10-28T13:56:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonnyhtwilliams](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtwilliams/32/567_2.png) [@jonnyhtwilliams](https://cylc.discourse.group/u/jonnyhtwilliams)\
**Post date:** [October 28, 2026, 1:56pm UTC](https://cylc.discourse.group/t/cylc-version-stripping-1-suffix-at-runtime/1360/1 "2026-10-28T13:56:18Z")

</div>

Hi there.

We have Cylc 8.7.0-1 installed and I want to use it in my Rose suite definition via `$CYLC_VERSION`.

In my `.bash_profile` I have `export CYLC_VERSION=8.7.0-1` but when I `echo` `$CYLC_VERSION` in my task pre-script it gives me `8.7.0`, i.e. without the `-1` suffix.

This doesn’t seem to tally with the [docs](https://cylc.github.io/cylc-doc/stable/html/reference/env-vars.html#envvar-CYLC_VERSION) as far as I can see?

> CYLC\_VERSION Can be set by users (e.g. in `.bash_profile`) in order to select a specific Cylc environment. If set this wrapper will look for an installed environment called `cylc-$CYLC_VERSION` in the ROOT locations (if not set it will look for an installed environment called `cylc`). e.g, `export CYLC_VERSION=8.0.0-1`.

Have I misunderstood this?

Thanks

---

<div class="post-metadata">

**Author:** ![jfrost-mo](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jfrost-mo/32/209_2.png) [@jfrost-mo](https://cylc.discourse.group/u/jfrost-mo)\
**Post date:** [October 28, 2026, 2:38pm UTC](https://cylc.discourse.group/t/cylc-version-stripping-1-suffix-at-runtime/1360/2 "2026-10-28T14:38:06Z")

</div>

There are actually two definitions of what `$CYLC_VERSION` means depending on context, which is definitely a bit confusing.

The first is the one used by the wrapper script to determine what cylc installation to use. This is the one you set in your profile and that you have found the docs for. The `-1` suffix is for when there are multiple deployments of the same cylc version, perhaps with updated dependencies or configuration.

However, there is a second definition of `$CYLC_VERSION` as a [job script environment variable](https://cylc.github.io/cylc-doc/stable/html/reference/env-vars.html#job-script-environment-variables), which is just the version of cylc that is running. This is what you see within your actual jobs.

---

<div class="post-metadata">

**Author:** ![jonnyhtwilliams](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtwilliams/32/567_2.png) [@jonnyhtwilliams](https://cylc.discourse.group/u/jonnyhtwilliams)\
**Post date:** [October 28, 2026, 3:06pm UTC](https://cylc.discourse.group/t/cylc-version-stripping-1-suffix-at-runtime/1360/3 "2026-10-28T15:06:51Z")

</div>

Hi there!

> [@jfrost-mo](#):
>
> There are actually two definitions of what `$CYLC_VERSION` means depending on context, which is definitely a bit confusing.

Oh OK I think I get it now! So basically Cylc itself at runtime doesn’t know anything about the `-1`, which is just a site-specific thing to point at one of multiple versions, if there are any?

Much appreciated.

Jonny

---

<div class="post-metadata">

**Author:** ![jfrost-mo](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jfrost-mo/32/209_2.png) [@jfrost-mo](https://cylc.discourse.group/u/jfrost-mo)\
**Post date:** [October 28, 2026, 3:54pm UTC](https://cylc.discourse.group/t/cylc-version-stripping-1-suffix-at-runtime/1360/4 "2026-10-28T15:54:33Z")

</div>

> [@jonnyhtwilliams](#):
>
> just a site-specific thing to point at one of multiple versions, if there are any

Exactly. The name could be anything, as the wrapper script just uses it as the folder name to try and use, but by convention it is the cylc version with a suffix. Other examples you might see are “8” or “8-next” which is typically a symlink to the latest deployed/soon to be deployed version at a site.

---

<div class="post-metadata">

**Author:** ![dpmatthews](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/dpmatthews/32/26_2.png) [@dpmatthews](https://cylc.discourse.group/u/dpmatthews)\
**Post date:** [October 28, 2026, 7:04pm UTC](https://cylc.discourse.group/t/cylc-version-stripping-1-suffix-at-runtime/1360/5 "2026-10-28T19:04:25Z")

</div>

> [@jonnyhtwilliams](#):
>
> So basically Cylc itself at runtime doesn’t know anything about the `-1`

Yes it does - `CYLC_ENV_NAME` is set to the basename of the selected environment (so, in this case, `CYLC_ENV_NAME=cylc-8.7.0-1`).

---

<div class="post-metadata">

**Author:** ![jonnyhtwilliams](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtwilliams/32/567_2.png) [@jonnyhtwilliams](https://cylc.discourse.group/u/jonnyhtwilliams)\
**Post date:** [November 16, 2026, 12:06pm UTC](https://cylc.discourse.group/t/cylc-version-stripping-1-suffix-at-runtime/1360/6 "2026-11-16T12:06:35Z")

</div>

That works perfectly, thanks!
